35 #include <agrum/BN/BayesNet.h> 36 #include <agrum/BN/BayesNetFactory.h> 37 #include <agrum/BN/io/BNReader.h> 38 #include <agrum/agrum.h> 42 #ifndef DOXYGEN_SHOULD_SKIP_THIS 44 # undef COCO_PARSER_H__ 45 # undef COCO_SCANNER_H__ 46 # include <agrum/BN/io/UAI/cocoR/Parser.h> 62 template <
typename GUM_SCALAR >
63 class UAIBNReader:
public BNReader< GUM_SCALAR > {
74 UAIBNReader(BayesNet< GUM_SCALAR >* bn,
const std::string& filename);
83 UAIBN::Scanner& scanner();
86 const std::string& streamName()
const;
97 void buildFromQuartets(
98 std::vector< std::tuple<
float,
int,
int,
int > > quartets);
113 bool errIsError(Idx i);
115 std::string errMsg(Idx i);
118 void showElegantErrors(std::ostream& o = std::cerr);
121 void showElegantErrorsAndWarnings(std::ostream& o = std::cerr);
124 void showErrorsAndWarnings(std::ostream& o = std::cerr);
127 void showErrorCounts(std::ostream& o = std::cerr);
131 BayesNet< GUM_SCALAR >* bn__;
132 BayesNetFactory< GUM_SCALAR >* factory__;
133 UAIBN::Scanner* scanner__;
134 UAIBN::Parser* parser__;
136 std::string streamName__;
137 bool traceScanning__;
144 void addFatalError__(Idx lig,
146 const std::string& s);
147 void addError__(Idx lig, Idx col,
const std::string& s);
148 void addWarning__(Idx lig, Idx col,
const std::string& s);
152 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 153 extern template class UAIBNReader<
double >;