Darwin
1.10(beta)
|
Container and utility functions for factor graphs. More...
Public Member Functions | |
drwnFactorGraph () | |
construct an empty factor graph | |
drwnFactorGraph (const drwnVarUniversePtr &u) | |
construct a factor graph based on variables in universe u | |
drwnFactorGraph (const drwnFactorGraph &g) | |
copy constructor | |
virtual const char * | type () const |
returns object type as a string (e.g., Foo::type() { return "Foo"; }) | |
virtual drwnFactorGraph * | clone () const |
returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } | |
const drwnVarUniversePtr & | getUniverse () const |
return the universe of variables for this factor graph | |
int | numVariables () const |
returns the number of variables in the universe | |
int | numFactors () const |
returns the number of factors in the graph | |
int | numEdges () const |
returns the number of (hyper-)edges in the graph | |
void | addFactor (drwnTableFactor *psi) |
add a factor to the graph and takes ownership | |
void | copyFactor (const drwnTableFactor *psi) |
add a factor to the graph by copying | |
const drwnTableFactor * | getFactor (int indx) const |
returns the factor at index indx | |
void | deleteFactor (int indx) |
delete a factor from the graph | |
int | findFactor (const drwnClique &clique, bool bAllowSuperset=false) const |
returns the index of a factor defined over the clique (or a superset of it) | |
drwnClique | getClique (int indx) const |
returns the clique for the factor at index indx | |
drwnEdge | getEdge (int eindx) const |
returns the indices for the factors adjacent to edge eindx | |
drwnClique | getSepSet (int eindx) const |
returns the set of separator variables for edge eindx | |
double | getEnergy (const drwnFullAssignment &x) const |
compute energy for a given assignment | |
bool | addEdge (const drwnEdge &e) |
add an edge to the graph (and compute separator set) | |
bool | connectGraph (const set< drwnEdge > &edges) |
connect graph with given set of edges | |
virtual bool | connectGraph () |
connect graph using max-spanning tree for each variable | |
bool | connectBetheApprox () |
connect graph using the bethe-approximation | |
bool | save (drwnXMLNode &xml) const |
write object to XML node (see also write) | |
bool | load (drwnXMLNode &xml) |
read object from XML node (see also read) | |
drwnTableFactor * | operator[] (unsigned indx) |
const drwnTableFactor * | operator[] (unsigned indx) const |
![]() | |
bool | write (const char *filename) const |
write object to file (calls save) | |
bool | read (const char *filename) |
read object from file (calls load) | |
void | dump () const |
print object's current state to standard output (for debugging) | |
Static Public Member Functions | |
static drwnClique | getSepSet (const drwnFactor &psiA, const drwnFactor &psiB) |
returns the set of separator variables between factors psiA and psiB | |
Protected Types | |
typedef drwnTriplet< int, int, drwnClique > | _drwnFactorEdge |
Protected Member Functions | |
void | computeSeparatorSets () |
computes the sep-sets for each edge in _edges | |
Protected Attributes | |
drwnVarUniversePtr | _pUniverse |
all variables in the universe | |
vector< drwnTableFactor * > | _factors |
list of factors in the model | |
vector< _drwnFactorEdge > | _edges |
list of edges and sep-sets | |
Container and utility functions for factor graphs.