This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/VarElimSolver.h

42 lines
949 B
C
Raw Normal View History

2011-12-12 15:29:51 +00:00
#ifndef HORUS_VARELIMSOLVER_H
#define HORUS_VARELIMSOLVER_H
#include "unordered_map"
#include "Solver.h"
#include "FactorGraph.h"
#include "BayesNet.h"
2012-03-22 11:33:24 +00:00
#include "Horus.h"
2011-12-12 15:29:51 +00:00
using namespace std;
class VarElimSolver : public Solver
{
public:
VarElimSolver (const BayesNet&);
VarElimSolver (const FactorGraph&);
~VarElimSolver (void);
2012-03-22 11:33:24 +00:00
void runSolver (void) { }
Params getPosterioriOf (VarId);
Params getJointDistributionOf (const VarIds&);
2011-12-12 15:29:51 +00:00
private:
void createFactorList (void);
void introduceEvidence (void);
2012-03-22 11:33:24 +00:00
void chooseEliminationOrder (const VarIds&);
void processFactorList (const VarIds&);
2011-12-12 15:29:51 +00:00
void eliminate (VarId);
void printActiveFactors (void);
2012-03-22 11:33:24 +00:00
const BayesNet* bayesNet_;
const FactorGraph* factorGraph_;
vector<Factor*> factorList_;
VarIds elimOrder_;
2011-12-12 15:29:51 +00:00
unordered_map<VarId, vector<unsigned>> varFactors_;
};
#endif // HORUS_VARELIMSOLVER_H