aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
BIFReader.h File Reference

Definition of templatized reader of BIF files for Bayesian networks. More...

#include <fstream>
#include <iostream>
#include <string>
#include <agrum/BN/io/BNReader.h>
#include <agrum/BN/io/BIF/BIFReader_tpl.h>
Include dependency graph for BIFReader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gum::BIFReader< GUM_SCALAR >
 Definition of templatized reader of BIF files for Bayesian networks. More...

Namespaces

namespace  gum
 gum is the global namespace for all aGrUM entities

Variables

template class GUM_PUBLIC_BN gum::BIFReader< double >

Detailed Description

Definition of templatized reader of BIF files for Bayesian networks.

how to use it :

// OPTIONAL LISTENER CLASS
class aSimpleListener : public gum::Listener {
public:
void whenLoading(const void *buffer,int percent) {
// percent goes from 0 to 100 (whenLoading is called at most once for each
integer
between 0 and 100
// percent=200 received when End Of File.
}
};
// END OF OPTIONAL LISTENER
try {
gum::BIFReader<double> reader(&bn,std::string(args[1]));
// OPTIONAL SECTION
aSimpleListener l;
GUM_CONNECT(reader.scanner(),onLoad,l,aSimpleListener::whenLoading);
// END OF OPTIONNAL SECTION
if (reader.proceed()==0) {
std::cerr<<"Well done !"<<std::endl;
} else {
reader.showElegantErrorsAndWarnings();
reader.showErrorCounts();
}
} catch (gum::IOError& e) {GUM_SHOWERROR(e);}
return 0;
Definition of templatized reader of BIF files for Bayesian networks.
Definition BIFReader.h:150
Class representing a Bayesian network.
Definition BayesNet.h:99
Every class who would catch signal from signaler should derive from Listener.
Definition listener.h:93
#define GUM_SHOWERROR(e)
Definition exceptions.h:89
#define GUM_CONNECT(sender, signal, receiver, target)
Definition listener.h:117
Author
Pierre-Henri WUILLEMIN(_at_LIP6)

Definition in file BIFReader.h.