yay, my first commit
This commit is contained in:
@@ -17,15 +17,15 @@ enum ElimHeuristic
|
||||
};
|
||||
|
||||
|
||||
class EgNode : public VarNode {
|
||||
class EgNode : public VarNode
|
||||
{
|
||||
public:
|
||||
EgNode (VarNode* var) : VarNode (var) { }
|
||||
void addNeighbor (EgNode* n)
|
||||
{
|
||||
neighs_.push_back (n);
|
||||
}
|
||||
|
||||
void addNeighbor (EgNode* n) { neighs_.push_back (n); }
|
||||
|
||||
const vector<EgNode*>& neighbors (void) const { return neighs_; }
|
||||
|
||||
private:
|
||||
vector<EgNode*> neighs_;
|
||||
};
|
||||
@@ -35,6 +35,7 @@ class ElimGraph
|
||||
{
|
||||
public:
|
||||
ElimGraph (const BayesNet&);
|
||||
|
||||
~ElimGraph (void);
|
||||
|
||||
void addEdge (EgNode* n1, EgNode* n2)
|
||||
@@ -43,13 +44,19 @@ class ElimGraph
|
||||
n1->addNeighbor (n2);
|
||||
n2->addNeighbor (n1);
|
||||
}
|
||||
void addNode (EgNode*);
|
||||
EgNode* getEgNode (VarId) const;
|
||||
VarIds getEliminatingOrder (const VarIds&);
|
||||
void printGraphicalModel (void) const;
|
||||
void exportToGraphViz (const char*, bool = true,
|
||||
const VarIds& = VarIds()) const;
|
||||
void setIndexes();
|
||||
|
||||
void addNode (EgNode*);
|
||||
|
||||
EgNode* getEgNode (VarId) const;
|
||||
|
||||
VarIds getEliminatingOrder (const VarIds&);
|
||||
|
||||
void printGraphicalModel (void) const;
|
||||
|
||||
void exportToGraphViz (const char*, bool = true,
|
||||
const VarIds& = VarIds()) const;
|
||||
|
||||
void setIndexes();
|
||||
|
||||
static void setEliminationHeuristic (ElimHeuristic h)
|
||||
{
|
||||
@@ -57,14 +64,19 @@ class ElimGraph
|
||||
}
|
||||
|
||||
private:
|
||||
EgNode* getLowestCostNode (void) const;
|
||||
unsigned getNeighborsCost (const EgNode*) const;
|
||||
unsigned getWeightCost (const EgNode*) const;
|
||||
unsigned getFillCost (const EgNode*) const;
|
||||
unsigned getWeightedFillCost (const EgNode*) const;
|
||||
void connectAllNeighbors (const EgNode*);
|
||||
bool neighbors (const EgNode*, const EgNode*) const;
|
||||
EgNode* getLowestCostNode (void) const;
|
||||
|
||||
unsigned getNeighborsCost (const EgNode*) const;
|
||||
|
||||
unsigned getWeightCost (const EgNode*) const;
|
||||
|
||||
unsigned getFillCost (const EgNode*) const;
|
||||
|
||||
unsigned getWeightedFillCost (const EgNode*) const;
|
||||
|
||||
void connectAllNeighbors (const EgNode*);
|
||||
|
||||
bool neighbors (const EgNode*, const EgNode*) const;
|
||||
|
||||
vector<EgNode*> nodes_;
|
||||
vector<bool> marked_;
|
||||
|
Reference in New Issue
Block a user