golib  0.5
goFactorGraph< T, Tfloat > Class Template Reference

Factor graph for use with goMaxSum and goSumProduct. More...

#include <gofactorgraph.h>

Public Types

enum  FactorType { EXP, LOG }
 Indicates whether the used factors are exponential or logarithmic. More...
 
typedef goFGNode< T, Tfloat > NodeType
 
typedef goFGEdge< T, Tfloat > EdgeType
 
typedef goFixedArray< goAutoPtr< goFGNodeVariable< T, Tfloat > > > VariableArray
 
typedef goFixedArray< goAutoPtr< goFGNodeFactor< T, Tfloat > > > FactorArray
 
typedef goList< goAutoPtr< goFGEdge< T, Tfloat > > > EdgeList
 

Public Member Functions

void connect (goFGNode< T, Tfloat > *n1, goSize_t adjIndex1, goFGNode< T, Tfloat > *n2, goSize_t adjIndex2)
 Connect n1, "slot" adjIndex1 to n2, "slot" adjIndex2. More...
 
void setNormal ()
 Set all nodes to NodeType::NORMAL state.
 
goDouble operator() (const goMath::Vector< T > &X, FactorType ft=EXP)
 

Public Attributes

VariableArray myVariables
 
FactorArray myFactors
 
EdgeList myEdges
 

Detailed Description

template<class T, class Tfloat>
class goFactorGraph< T, Tfloat >

Factor graph for use with goMaxSum and goSumProduct.

Directly resize the arrays myVariables and myFactors, and connect them using the connect() member function.

Examples
sumproduct/sp.cpp.

Member Enumeration Documentation

◆ FactorType

template<class T, class Tfloat>
enum goFactorGraph::FactorType

Indicates whether the used factors are exponential or logarithmic.

If they are exponential, operator() uses multiplications to calculate the function value, otherwise it uses sums.

Member Function Documentation

◆ connect()

template<class T, class Tfloat>
void goFactorGraph< T, Tfloat >::connect ( goFGNode< T, Tfloat > *  n1,
goSize_t  adjIndex1,
goFGNode< T, Tfloat > *  n2,
goSize_t  adjIndex2 
)
inline

Connect n1, "slot" adjIndex1 to n2, "slot" adjIndex2.

Parameters
n1Node 1
adjIndex1Index of the edge in node 1
n2Node 2
adjIndex2Index of the edge in node 2

The documentation for this class was generated from the following file: