aGrUM  0.16.0
UAIWriter.h
Go to the documentation of this file.
1 
32 #ifndef GUM_UAIWRITER_H
33 #define GUM_UAIWRITER_H
34 
35 
36 #include <fstream>
37 #include <iostream>
38 #include <sstream>
39 #include <string>
40 
41 #include <agrum/BN/io/BNWriter.h>
42 #include <agrum/agrum.h>
43 
44 namespace gum {
56  template < typename GUM_SCALAR >
57  class UAIWriter : public BNWriter< GUM_SCALAR > {
58  public:
59  // ==========================================================================
61  // ==========================================================================
63 
67  UAIWriter();
68 
72  ~UAIWriter() final;
73 
75 
83  void write(std::ostream& output, const IBayesNet< GUM_SCALAR >& bn) final;
84 
94  void write(const std::string& filePath,
95  const IBayesNet< GUM_SCALAR >& bn) final;
96 
97  private:
101  std::string __preambule(const IBayesNet< GUM_SCALAR >& bn);
102 
103  std::string __cptBloc(const IBayesNet< GUM_SCALAR >& bn, NodeId node);
104  };
105 
106 
107 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
108  extern template class UAIWriter< double >;
109 #endif
110 
111 } /* namespace gum */
112 
114 #endif // GUM_UAIWRITER_H
~UAIWriter() final
Destructor.
Class representing the minimal interface for Bayesian Network.
Definition: IBayesNet.h:62
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
<agrum/BN/io/UAI/UAIWriter.h>
Definition: UAIWriter.h:57
std::string __cptBloc(const IBayesNet< GUM_SCALAR > &bn, NodeId node)
void write(std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final
Writes an bayes net in the given ouput stream.
UAIWriter()
Default constructor.
std::string __preambule(const IBayesNet< GUM_SCALAR > &bn)
Returns the header of the BIF file.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Pure virtual class for writting a BN to a file.
Definition: BNWriter.h:57
Size NodeId
Type for node ids.
Definition: graphElements.h:98