Direct Graphical Models  v.1.7.0
InferLBP.h
1 // Loopy Belief Propagation inference class interface
2 // Written by Sergey G. Kosov in 2013 for Chronos Vision GmbH
3 // Adopted by Sergey G. Kosov in 2015 for Project X
4 #pragma once
5 
6 #include "MessagePassing.h"
7 
8 namespace DirectGraphicalModels
9 {
10  // ==================== Loopy Belief Propagation Infer Class ==================
16  class CInferLBP : public CMessagePassing
17  {
18  public:
23  DllExport CInferLBP(CGraphPairwise &graph) : CMessagePassing(graph), m_maxSum(false) {}
24  DllExport virtual ~CInferLBP(void) {}
25 
26 
27  protected:
28  DllExport virtual void calculateMessages(unsigned int nIt);
29  void setMaxSum(bool maxSum) { m_maxSum = maxSum; }
30  bool isMaxSum(void) const { return m_maxSum; }
31 
32 
33  private:
34  bool m_maxSum;
35  };
36 
37 }
CInferLBP(CGraphPairwise &graph)
Constructor.
Definition: InferLBP.h:23
Abstract base class for message passing inference algorithmes.
bool isMaxSum(void) const
Definition: InferLBP.h:30
void setMaxSum(bool maxSum)
Definition: InferLBP.h:29
virtual void calculateMessages(unsigned int nIt)
Calculates messages, associated with the edges of corresponding graphical model.
Definition: InferLBP.cpp:6
bool m_maxSum
Flag indicating weather the max-sum LBP (Viterbi algorithm) should be applied.
Definition: InferLBP.h:34
Sum product Loopy Belief Propagation inference class.
Definition: InferLBP.h:16