aGrUM  0.16.0
CNFWriter.h
Go to the documentation of this file.
1 
33 #ifndef GUM_CNF_WRITER_H
34 #define GUM_CNF_WRITER_H
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>
44 #include <agrum/core/hashTable.h>
45 
46 // Ajout sur branche DDE pour pouvoir compiler (à retirer très probablement)
47 // problème sur template <typename> class IApproximationPolicy = ExactPolicy
48 // sinon
49 // (reconnaissance de ExactPolicy?)
51 
52 namespace gum {
53 
66  template < typename GUM_SCALAR,
67  template < typename > class IApproximationPolicy = ExactPolicy >
68  class CNFWriter
69  : public BNWriter< GUM_SCALAR >
70  , public IApproximationPolicy< GUM_SCALAR > {
71  public:
72  // ==========================================================================
74  // ==========================================================================
76 
80  CNFWriter();
81 
85  ~CNFWriter() override;
86 
88 
96  void write(std::ostream& output,
97  const IBayesNet< GUM_SCALAR >& bn) override = 0;
98 
107  void write(const std::string& filePath,
108  const IBayesNet< GUM_SCALAR >& bn) override = 0;
109 
110  inline GUM_SCALAR fromExact(const GUM_SCALAR& value) const override {
111  return IApproximationPolicy< GUM_SCALAR >::fromExact(value);
112  }
113  };
114 
115 
116 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
117  extern template class CNFWriter< double >;
118 #endif
119 
120 } /* namespace gum */
121 
123 #endif // GUM_NET_WRITER_H
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void write(std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) override=0
Writes a Bayesian Network in the output stream using the BN format.
GUM_SCALAR fromExact(const GUM_SCALAR &value) const override
Definition: CNFWriter.h:110
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
Writes a IBayesNet in the BN format.
Definition: CNFWriter.h:68
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
CNFWriter()
Default constructor.
~CNFWriter() override
Destructor.
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.