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(std::vector< std::tuple<
float,
int,
int,
int > > quartets);
112 bool errIsError(Idx i);
114 std::string errMsg(Idx i);
117 void showElegantErrors(std::ostream& o = std::cerr);
120 void showElegantErrorsAndWarnings(std::ostream& o = std::cerr);
123 void showErrorsAndWarnings(std::ostream& o = std::cerr);
126 void showErrorCounts(std::ostream& o = std::cerr);
130 BayesNet< GUM_SCALAR >* _bn_;
131 BayesNetFactory< GUM_SCALAR >* _factory_;
132 UAIBN::Scanner* _scanner_;
133 UAIBN::Parser* _parser_;
135 std::string _streamName_;
136 bool _traceScanning_;
143 void _addFatalError_(Idx lig, Idx col,
144 const std::string& s);
145 void _addError_(Idx lig, Idx col,
const std::string& s);
146 void _addWarning_(Idx lig, Idx col,
const std::string& s);
150 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 151 extern template class UAIBNReader<
double >;