aGrUM  0.13.2
gum::CNFWriter< GUM_SCALAR, IApproximationPolicy > Class Template Referenceabstract

Writes a IBayesNet in the BN format. More...

#include <agrum/BN/io/cnf/CNFWriter.h>

+ Inheritance diagram for gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >:
+ Collaboration diagram for gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >:

Public Member Functions

void write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) override=0
 Writes a Bayesian Network in the output stream using the BN format. More...
 
void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) override=0
 Writes a Bayesian Network in the referenced file using the BN format. More...
 
GUM_SCALAR fromExact (const GUM_SCALAR &value) const override
 
Constructor & destructor
 CNFWriter ()
 Default constructor. More...
 
 ~CNFWriter () override
 Destructor. More...
 

Detailed Description

template<typename GUM_SCALAR, template< typename > class IApproximationPolicy = ExactPolicy>
class gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >

Writes a IBayesNet in the BN format.

This class servers to write the content of a Bayesian Network in the BN format. See TODO for information on this format.

Definition at line 65 of file CNFWriter.h.

Constructor & Destructor Documentation

template<typename GUM_SCALAR , template< typename > class IApproximationPolicy = ExactPolicy>
gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >::CNFWriter ( )

Default constructor.

template<typename GUM_SCALAR , template< typename > class IApproximationPolicy = ExactPolicy>
gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >::~CNFWriter ( )
override

Destructor.

Member Function Documentation

template<typename GUM_SCALAR , template< typename > class IApproximationPolicy = ExactPolicy>
GUM_SCALAR gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >::fromExact ( const GUM_SCALAR &  value) const
inlineoverride

Definition at line 107 of file CNFWriter.h.

107  {
108  return IApproximationPolicy< GUM_SCALAR >::fromExact(value);
109  }
template<typename GUM_SCALAR , template< typename > class IApproximationPolicy = ExactPolicy>
void gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >::write ( std::ostream &  output,
const IBayesNet< GUM_SCALAR > &  bn 
)
overridepure virtual

Writes a Bayesian Network in the output stream using the BN format.

Parameters
outputThe output stream.
bnThe Bayesian Network writen in output.
Exceptions
IOErrorRaised if and I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.

Implemented in gum::ContextualDependenciesCNFWriter< GUM_SCALAR, IApproximationPolicy >, gum::FactorisedValuesCNFWriter< GUM_SCALAR, IApproximationPolicy >, and gum::GeneralizedCNFWriter< GUM_SCALAR, IApproximationPolicy >.

template<typename GUM_SCALAR , template< typename > class IApproximationPolicy = ExactPolicy>
void gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >::write ( const std::string &  filePath,
const IBayesNet< GUM_SCALAR > &  bn 
)
overridepure virtual

Writes a Bayesian Network in the referenced file using the BN format.

If the files doesn't exists, it is created.

Parameters
filePathThe path to the file used to write the Bayesian Network.
bnThe Bayesian Network writed in the file.
Exceptions
IOErrorRaised if and I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.

Implemented in gum::ContextualDependenciesCNFWriter< GUM_SCALAR, IApproximationPolicy >, gum::FactorisedValuesCNFWriter< GUM_SCALAR, IApproximationPolicy >, and gum::GeneralizedCNFWriter< GUM_SCALAR, IApproximationPolicy >.


The documentation for this class was generated from the following file: