Public Member Functions

BeliefPropagator Class Reference

Object that maintains and updates the state of belief propagation. More...

#include <BeliefPropagator.h>

List of all members.

Public Member Functions

void  setWeightOracle (WeightOracle *wo)
bool  checkConvergence ()
void  updateBeliefs ()
SparseMatrix< bool > *  getEstimate ()
int  getIteration ()
void  setMaxIter (int i)
void  setB (int *degrees)
void  setB (int *brows, int *bcols)
void  updateRow (double *newAlpha, double *newBeta, int i)
int  getViolatedColumns ()
double  getIterationTime ()
double  getChangeX ()

Detailed Description

Object that maintains and updates the state of belief propagation.


Member Function Documentation

bool BeliefPropagator::checkConvergence (  )

Returns whether belief propagation has reached a valid solution

Returns:
whether belief propagation has converged
double BeliefPropagator::getChangeX (  ) [inline]
Returns:
change in beliefs in previous iteration
SparseMatrix< bool > * BeliefPropagator::getEstimate (  )

Returns the current estimated solution

Returns:
current estimated solution as a pointer to a SparseMatrix
int BeliefPropagator::getIteration (  )

Returns the current iteration number

Returns:
current iteration number
double BeliefPropagator::getIterationTime (  ) [inline]
Returns:
time to compute previous iteration
int BeliefPropagator::getViolatedColumns (  ) [inline]
Returns:
number of columns with incorrect neighbor count
void BeliefPropagator::setB ( int *   brows,
int *   bcols  
)

Sets the degree constraints as a row vector and column vector (for bipartite case only)

Parameters:
[in]browsint array of target degrees for first bipartition (row degrees)
[in]bcolsint array of target degrees for second bipartition (column degrees) prerequisite The weight oracle must be set before setB is called.
void BeliefPropagator::setB ( int *   degrees  )

Sets the degree constraints as a single vector

Parameters:
[in]degreesint array containing the target degrees for each node
void BeliefPropagator::setMaxIter ( int   i  )

Set the maximum number of iterations before giving up

Parameters:
[in]inew maximum iteration value
void BeliefPropagator::setWeightOracle ( WeightOracle *   wo  )

Attach a WeightOracle to this Belief Propagator

Parameters:
[in]woThe weight oracle that returns the weights for this b-matching problem
void BeliefPropagator::updateBeliefs (  )

Runs one iteration of belief propagation

void BeliefPropagator::updateRow ( double *   newAlpha,
double *   newBeta,
int   i  
)

updates the beliefs for row. Don't use this method. This is temporarily public to allow a quick multithreading patch


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Defines