aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::NetWriter< GUM_SCALAR > Class Template Reference

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

#include <agrum/BN/io/net/netWriter.h>

+ Inheritance diagram for gum::NetWriter< GUM_SCALAR >:
+ Collaboration diagram for gum::NetWriter< GUM_SCALAR >:

Public Member Functions

void write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final
 Writes a Bayesian network in the output stream using the BN format. More...
 
void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final
 Writes a Bayesian network in the referenced file using the BN format. More...
 
Constructor & destructor
 NetWriter ()
 Default constructor. More...
 
 ~NetWriter () final
 Destructor. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::NetWriter< GUM_SCALAR >

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 59 of file netWriter.h.

Constructor & Destructor Documentation

◆ NetWriter()

template<typename GUM_SCALAR >
gum::NetWriter< GUM_SCALAR >::NetWriter ( )

Default constructor.

◆ ~NetWriter()

template<typename GUM_SCALAR >
gum::NetWriter< GUM_SCALAR >::~NetWriter ( )
final

Destructor.

Member Function Documentation

◆ _header_()

template<typename GUM_SCALAR >
std::string gum::NetWriter< GUM_SCALAR >::_header_ ( const IBayesNet< GUM_SCALAR > &  bn)
private

◆ _variableBloc_()

template<typename GUM_SCALAR >
std::string gum::NetWriter< GUM_SCALAR >::_variableBloc_ ( const DiscreteVariable var)
private

◆ _variableCPT_()

template<typename GUM_SCALAR >
std::string gum::NetWriter< GUM_SCALAR >::_variableCPT_ ( const Potential< GUM_SCALAR > &  cpt)
private

◆ write() [1/2]

template<typename GUM_SCALAR >
void gum::NetWriter< GUM_SCALAR >::write ( std::ostream &  output,
const IBayesNet< GUM_SCALAR > &  bn 
)
finalvirtual

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 >.

◆ write() [2/2]

template<typename GUM_SCALAR >
void gum::NetWriter< GUM_SCALAR >::write ( const std::string &  filePath,
const IBayesNet< GUM_SCALAR > &  bn 
)
finalvirtual

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 >.


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