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

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

#include <agrum/BN/io/BIF/BIFWriter.h>

+ Inheritance diagram for gum::BIFWriter< GUM_SCALAR >:
+ Collaboration diagram for gum::BIFWriter< 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 BIF format. More...
 
void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final
 Writes a Bayesian network in the referenced file using the BIF format. More...
 
Constructor & destructor
 BIFWriter ()
 Default constructor. More...
 
 ~BIFWriter () final
 Destructor. More...
 

Detailed Description

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

Writes a IBayesNet in the BIF format.

This class servers to write the content of a Bayesian network in the BIF format. See http://www.cs.cmu.edu/~fgcozman/Research/InterchangeFormat/Old/xmlbif02.html for information on this format.

Definition at line 59 of file BIFWriter.h.

Constructor & Destructor Documentation

◆ BIFWriter()

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

Default constructor.

◆ ~BIFWriter()

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

Destructor.

Member Function Documentation

◆ _header_()

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

◆ _variableBloc_()

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

◆ _variableCPT_()

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

◆ _variablesLabels_()

template<typename GUM_SCALAR >
std::string gum::BIFWriter< GUM_SCALAR >::_variablesLabels_ ( const Sequence< const DiscreteVariable * > &  varsSeq,
const Instantiation inst 
)
private

◆ write() [1/2]

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

Writes a Bayesian network in the output stream using the BIF 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::BIFWriter< GUM_SCALAR >::write ( const std::string &  filePath,
const IBayesNet< GUM_SCALAR > &  bn 
)
finalvirtual

Writes a Bayesian network in the referenced file using the BIF 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: