![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/BN/io/XDSLXML/XDSLBNWriter.h> More...
#include <XDSLBNWriter.h>
Public Member Functions | |
| void | write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) |
| Writes a Bayesian network in the output stream. | |
| void | write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) |
| Writes a Bayesian network in the file referenced by filePath. | |
| GUM_NODISCARD bool | isModificationAllowed () const |
| void | setAllowModification (bool am) |
Constructor & destructor | |
| XDSLBNWriter () | |
| Default constructor. | |
| ~XDSLBNWriter () override | |
| Destructor. | |
| XDSLBNWriter (const XDSLBNWriter &)=default | |
| Default constructor. | |
| XDSLBNWriter (XDSLBNWriter &&) noexcept=default | |
| Default constructor. | |
| XDSLBNWriter & | operator= (const XDSLBNWriter &)=default |
| Default constructor. | |
| XDSLBNWriter & | operator= (XDSLBNWriter &&) noexcept=default |
| Default constructor. | |
Protected Member Functions | |
| void | _doWrite (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final |
| Writes an bayes net in the given ouput stream. | |
| void | _doWrite (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final |
| Writes an bayes net in the file referenced by filePath. | |
Private Member Functions | |
| void | _heading_ (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) |
| send to output the header of the XDSL file. | |
| void | _documentEnd_ (std::ostream &output) |
| send to output the end of the XDSL file. | |
| void | _headingExtension_ (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) |
| void | _endExtension_ (std::ostream &output) |
| void | _variableBloc_ (std::ostream &output, const NodeId &varNodeId, const IBayesNet< GUM_SCALAR > &bn) |
| send to output a bloc defining a variable in the XDSL format. | |
| void | _variableExtension_ (std::ostream &output, const NodeId &varNodeId, const IBayesNet< GUM_SCALAR > &bn) |
| send to output a bloc defining a variable's extensoion in the XDSL | |
| virtual void | _syntacticalCheck (const IBayesNet< GUM_SCALAR > &bn) |
| Check whether the BN is syntactically correct for BIF format. | |
| void | _validCharInNamesCheck (const IBayesNet< GUM_SCALAR > &bn) |
| } | |
| std::string | _onlyValidCharsInName (const std::string &name) |
| } | |
| std::string | _buildNameWithOnlyValidChars (const std::string &name) |
| } | |
| bool | _allowModification_ = false |
| } | |
<agrum/BN/io/XDSLXML/XDSLBNWriter.h>
Writes an bayes net in a XML file with XDSL format
This class export a bayes net into an XML files, using XDSL format
Definition at line 78 of file XDSLBNWriter.h.
| gum::XDSLBNWriter< GUM_SCALAR >::XDSLBNWriter | ( | ) |
Default constructor.
Referenced by XDSLBNWriter(), XDSLBNWriter(), _variableExtension_(), operator=(), and operator=().
|
override |
Destructor.
|
default |
|
defaultnoexcept |
|
protectedinherited |
}
References _buildNameWithOnlyValidChars().
Referenced by _buildNameWithOnlyValidChars().
|
private |
send to output the end of the XDSL file.
References _documentEnd_().
Referenced by _documentEnd_().
|
finalprotectedvirtual |
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.
| filePath | The path to the file used to write the bayes net. |
| bn | The bayes net writen in the file. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
References _doWrite().
|
finalprotectedvirtual |
Writes an bayes net in the given ouput stream.
| output | The output stream. |
| bn | The bayes net writen in the stream. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
References _doWrite().
Referenced by _doWrite(), and _doWrite().
|
private |
References _endExtension_().
Referenced by _endExtension_().
|
private |
send to output the header of the XDSL file.
References _heading_().
Referenced by _heading_().
|
private |
References _headingExtension_().
Referenced by _headingExtension_().
|
protectedinherited |
}
References _onlyValidCharsInName().
Referenced by _onlyValidCharsInName().
|
protectedvirtualinherited |
Check whether the BN is syntactically correct for BIF format.
| FatalError | if found. |
Reimplemented in gum::BIFWriter< GUM_SCALAR >, and gum::DSLWriter< GUM_SCALAR >.
References _syntacticalCheck().
Referenced by _syntacticalCheck().
|
protectedinherited |
}
References _validCharInNamesCheck().
Referenced by _validCharInNamesCheck().
|
private |
send to output a bloc defining a variable in the XDSL format.
References _variableBloc_().
Referenced by _variableBloc_().
|
private |
send to output a bloc defining a variable's extensoion in the XDSL
References XDSLBNWriter(), and _variableExtension_().
Referenced by _variableExtension_().
|
inherited |
References GUM_NODISCARD, and isModificationAllowed().
Referenced by isModificationAllowed().
|
default |
|
defaultnoexcept |
|
inherited |
References setAllowModification().
Referenced by setAllowModification().
|
inherited |
Writes a Bayesian network in the file referenced by filePath.
| filePath | The path to the file used to write the Bayesian network. |
| bn | The Bayesian network writen in the file. |
| IOError | Raised if an I/O error occurs. |
References write().
|
inherited |
Writes a Bayesian network in the output stream.
| output | The output stream. |
| bn | The Bayesian network written in output. |
| IOError | Raised if an I/O error occurs. |
| SyntaxError | Raised if syntactical errors in the BN |
References write().
Referenced by gum::credal::CredalNet< GUM_SCALAR >::saveBNsMinMax(), write(), and write().
|
privateinherited |
}
Definition at line 163 of file BNWriter.h.