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

<agrum/BN/io/UAI/UAIBNWriter.h> More...

#include <UAIBNWriter.h>

+ Inheritance diagram for gum::UAIBNWriter< GUM_SCALAR >:
+ Collaboration diagram for gum::UAIBNWriter< 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
 UAIBNWriter ()
 Default constructor. More...
 
 ~UAIBNWriter () final
 Destructor. More...
 

Detailed Description

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

<agrum/BN/io/UAI/UAIBNWriter.h>

Writes an bayes net in a text file with UAI format

This class export a bayes net into an text file, using UAI format

cf. http://www.cs.huji.ac.il/project/PASCAL/fileFormat.php

Definition at line 56 of file UAIBNWriter.h.

Constructor & Destructor Documentation

◆ UAIBNWriter()

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

Default constructor.

◆ ~UAIBNWriter()

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

Destructor.

Member Function Documentation

◆ _cptBloc_()

template<typename GUM_SCALAR >
std::string gum::UAIBNWriter< GUM_SCALAR >::_cptBloc_ ( const IBayesNet< GUM_SCALAR > &  bn,
NodeId  node 
)
private

◆ _preambule_()

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

Returns the header of the BIF file.

◆ write() [1/2]

template<typename GUM_SCALAR >
void gum::UAIBNWriter< 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.
bnThe 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::UAIBNWriter< 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.
bnThe 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: