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(
95 std::vector< std::tuple<
float,
int,
int,
int > > quartets);
110 bool errIsError(Idx i);
112 std::string errMsg(Idx i);
115 void showElegantErrors(std::ostream& o = std::cerr);
118 void showElegantErrorsAndWarnings(std::ostream& o = std::cerr);
121 void showErrorsAndWarnings(std::ostream& o = std::cerr);
124 void showErrorCounts(std::ostream& o = std::cerr);
128 MarkovNet< GUM_SCALAR >* mn__;
129 UAIMN::Scanner* scanner__;
130 UAIMN::Parser* parser__;
132 std::string streamName__;
133 bool traceScanning__;
140 void addFatalError__(Idx lig,
142 const std::string& s);
143 void addError__(Idx lig, Idx col,
const std::string& s);
144 void addWarning__(Idx lig, Idx col,
const std::string& s);
148 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 149 extern template class UAIMNReader<
double >;