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

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org. More...

#include <fstream>
#include <iostream>
#include <string>
#include <agrum/BN/BayesNetFactory.h>
#include <agrum/BN/IBayesNet.h>
#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

 gum
 Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
 

Detailed Description

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.

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 recieved 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;
Author
Pierre-Henri WUILLEMIN()

Definition in file BIFReader.h.