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/horus/VarElim.h

47 lines
795 B
C
Raw Normal View History

#ifndef HORUS_VARELIM_H
#define HORUS_VARELIM_H
2012-05-23 14:56:01 +01:00
#include "unordered_map"
#include "Solver.h"
#include "FactorGraph.h"
#include "Horus.h"
using namespace std;
class VarElim : public Solver
2012-05-23 14:56:01 +01:00
{
public:
VarElim (const FactorGraph& fg) : Solver (fg) { }
2012-05-23 14:56:01 +01:00
~VarElim (void);
2012-05-23 14:56:01 +01:00
Params solveQuery (VarIds);
void printSolverFlags (void) const;
private:
void createFactorList (void);
void absorveEvidence (void);
void findEliminationOrder (const VarIds&);
void processFactorList (const VarIds&);
void eliminate (VarId);
void printActiveFactors (void);
Factors factorList_;
VarIds elimOrder_;
unsigned largestFactorSize_;
unsigned totalFactorSize_;
2012-05-24 22:55:20 +01:00
unordered_map<VarId, vector<size_t>> varFactors_;
2012-05-23 14:56:01 +01:00
};
#endif // HORUS_VARELIM_H
2012-05-23 14:56:01 +01:00