Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LoopyBelief Class Reference

Classes

struct  StarGraph
 

Public Member Functions

DiscreteFactorGraph::shared_ptr iterate (const std::map< Key, DiscreteKey > &allDiscreteKeys)
 One step of belief propagation. More...
 
 LoopyBelief (const DiscreteFactorGraph &graph, const std::map< Key, DiscreteKey > &allDiscreteKeys)
 
void print (const std::string &s="") const
 print More...
 

Private Types

typedef std::map< Key, size_tCorrectedBeliefIndices
 
typedef std::map< Key, StarGraphStarGraphs
 

Private Member Functions

StarGraphs buildStarGraphs (const DiscreteFactorGraph &graph, const std::map< Key, DiscreteKey > &allDiscreteKeys) const
 

Private Attributes

StarGraphs starGraphs_
 star graph at each variable More...
 

Detailed Description

Loopy belief solver for graphs with only binary and unary factors

Definition at line 24 of file testLoopyBelief.cpp.

Member Typedef Documentation

◆ CorrectedBeliefIndices

typedef std::map<Key, size_t> LoopyBelief::CorrectedBeliefIndices
private

Star graph struct for each node, containing

  • the star graph itself
  • the product of original unary factors so we don't have to recompute it later, and
  • the factor indices of the corrected belief factors of the neighboring nodes

Definition at line 32 of file testLoopyBelief.cpp.

◆ StarGraphs

typedef std::map<Key, StarGraph> LoopyBelief::StarGraphs
private

Definition at line 57 of file testLoopyBelief.cpp.

Constructor & Destructor Documentation

◆ LoopyBelief()

LoopyBelief::LoopyBelief ( const DiscreteFactorGraph graph,
const std::map< Key, DiscreteKey > &  allDiscreteKeys 
)
inline

Constructor Need all discrete keys to access node's cardinality for creating belief factors TODO: so troublesome!!

Definition at line 66 of file testLoopyBelief.cpp.

Member Function Documentation

◆ buildStarGraphs()

StarGraphs LoopyBelief::buildStarGraphs ( const DiscreteFactorGraph graph,
const std::map< Key, DiscreteKey > &  allDiscreteKeys 
) const
inlineprivate

Build star graphs for each node.

< access to all factors of each node

Definition at line 169 of file testLoopyBelief.cpp.

◆ iterate()

DiscreteFactorGraph::shared_ptr LoopyBelief::iterate ( const std::map< Key, DiscreteKey > &  allDiscreteKeys)
inline

One step of belief propagation.

Definition at line 79 of file testLoopyBelief.cpp.

◆ print()

void LoopyBelief::print ( const std::string &  s = "") const
inline

print

Definition at line 71 of file testLoopyBelief.cpp.

Member Data Documentation

◆ starGraphs_

StarGraphs LoopyBelief::starGraphs_
private

star graph at each variable

Definition at line 58 of file testLoopyBelief.cpp.


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


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:43:36