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

<agrum/BN/io/BIFXML/BIFXMLBNWriter.h> More...

#include <BIFXMLBNWriter.h>

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

Public Member Functions

void write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final
 Writes an bayes net in the given ouput stream. More...
 
void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final
 Writes an bayes net in the file referenced by filePath. More...
 
Constructor & destructor
 BIFXMLBNWriter ()
 Default constructor. More...
 
 ~BIFXMLBNWriter () final
 Destructor. More...
 

Detailed Description

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

<agrum/BN/io/BIFXML/BIFXMLBNWriter.h>

Writes an bayes net in a XML file with BIF format

This class export a bayes net into an XML files, using BIF format See http://www-2.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/ for information about this format.

Definition at line 60 of file BIFXMLBNWriter.h.

Constructor & Destructor Documentation

◆ BIFXMLBNWriter()

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

Default constructor.

◆ ~BIFXMLBNWriter()

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

Destructor.

Member Function Documentation

◆ _documentend_()

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::_documentend_ ( )
private

Returns the end of the BIF file.

◆ _heading_()

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

Returns the header of the BIF file.

◆ _variableBloc_()

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

Returns a bloc defining a variable in the BIF format.

◆ _variableDefinition_()

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::_variableDefinition_ ( const NodeId varNodeId,
const IBayesNet< GUM_SCALAR > &  bn 
)
private

Returns a bloc defining a variable's table (if she has) in the BIF format.

◆ write() [1/2]

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

Writes an bayes net in the given ouput stream.

Parameters
outputThe output stream.
infdiagThe bayes net writen in the stream.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.

◆ write() [2/2]

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

Writes an bayes net in the file referenced by filePath.

If the file doesn't exists, it is created. If the file exists, it's content will be erased.

Parameters
filePathThe path to the file used to write the bayes net.
infdiagThe bayes net writen in the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.


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