30 #ifndef UAI_MN_READER_H 31 #define UAI_MN_READER_H 33 #include <agrum/MN/MarkovNet.h> 34 #include <agrum/MN/io/MNReader.h> 35 #include <agrum/agrum.h> 39 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 # undef _COCO_PARSER_H_ 42 # undef _COCO_SCANNER_H_ 43 # include <agrum/MN/io/UAI/cocoR/Parser.h> 59 template <
typename GUM_SCALAR >
60 class UAIMNReader:
public MNReader< GUM_SCALAR > {
71 UAIMNReader(MarkovNet< GUM_SCALAR >* MN,
const std::string& filename);
80 UAIMN::Scanner& scanner();
83 const std::string& streamName()
const;
94 void buildFromQuartets(std::vector< std::tuple<
float,
int,
int,
int > > quartets);
109 bool errIsError(Idx i);
111 std::string errMsg(Idx i);
114 void showElegantErrors(std::ostream& o = std::cerr);
117 void showElegantErrorsAndWarnings(std::ostream& o = std::cerr);
120 void showErrorsAndWarnings(std::ostream& o = std::cerr);
123 void showErrorCounts(std::ostream& o = std::cerr);
127 MarkovNet< GUM_SCALAR >* _mn_;
128 UAIMN::Scanner* _scanner_;
129 UAIMN::Parser* _parser_;
131 std::string _streamName_;
132 bool _traceScanning_;
139 void _addFatalError_(Idx lig, Idx col,
140 const std::string& s);
141 void _addError_(Idx lig, Idx col,
const std::string& s);
142 void _addWarning_(Idx lig, Idx col,
const std::string& s);
146 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 147 extern template class UAIMNReader<
double >;