Direct Graphical Models  v.1.7.0
DirectGraphicalModels::CDecodeExact Class Reference

Exact decoding class. More...

#include <DecodeExact.h>

Inheritance diagram for DirectGraphicalModels::CDecodeExact:
Collaboration diagram for DirectGraphicalModels::CDecodeExact:

Public Member Functions

 CDecodeExact (IGraphPairwise &graph)
 Constructor. More...
 
virtual ~CDecodeExact (void)
 
virtual vec_byte_t decode (Mat &lossMatrix=EmptyMat) const
 Exact decoding. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CDecode
virtual ~CDecode (void)
 

Protected Member Functions

IGraphPairwisegetGraphPairwise (void) const
 Returns the graph. More...
 
void setState (vec_byte_t &state, qword configuration) const
 Sets the state according to the configuration index configuration. More...
 
void incState (vec_byte_t &state) const
 Increases the state by one, i.e. switches the state array to the consequent configuration. More...
 
vec_float_t calculatePotentials (void) const
 Calculates potentials for all possible configurations. More...
 
- Protected Member Functions inherited from DirectGraphicalModels::CDecode
 CDecode (CGraph &graph)
 Constructor. More...
 
CGraphgetGraph (void) const
 Returns the reference to the graph. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DirectGraphicalModels::CDecode
static vec_byte_t decode (const CGraph &graph, Mat &lossMatrix=EmptyMat)
 Approximate decoding. More...
 
static Mat getDefaultLossMatrix (byte nStates)
 Returns a default loss matrix \(L\). More...
 

Detailed Description

Exact decoding class.

Note
Use this class only if \( nStates^{nNodes} < 2^{32}\)
Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 17 of file DecodeExact.h.

Constructor & Destructor Documentation

◆ CDecodeExact()

DirectGraphicalModels::CDecodeExact::CDecodeExact ( IGraphPairwise graph)
inline

Constructor.

Parameters
graphThe graph

Definition at line 24 of file DecodeExact.h.

◆ ~CDecodeExact()

virtual DirectGraphicalModels::CDecodeExact::~CDecodeExact ( void  )
inlinevirtual

Definition at line 25 of file DecodeExact.h.

Member Function Documentation

◆ calculatePotentials()

vec_float_t DirectGraphicalModels::CDecodeExact::calculatePotentials ( void  ) const
protected

Calculates potentials for all possible configurations.

This function is used in exact inference / decoding

Returns
\(nStates^{nNodes}\) potentials, corresponding to the all possible configurations (states destributed along the nodes)

Definition at line 58 of file DecodeExact.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode()

vec_byte_t DirectGraphicalModels::CDecodeExact::decode ( Mat &  lossMatrix = EmptyMat) const
virtual

Exact decoding.

Parameters
lossMatrixis not used
Returns
The most probable configuration

Reimplemented from DirectGraphicalModels::CDecode.

Definition at line 7 of file DecodeExact.cpp.

Here is the call graph for this function:

◆ getGraphPairwise()

IGraphPairwise& DirectGraphicalModels::CDecodeExact::getGraphPairwise ( void  ) const
inlineprotected

Returns the graph.

Returns
The graph

Definition at line 40 of file DecodeExact.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ incState()

void DirectGraphicalModels::CDecodeExact::incState ( vec_byte_t &  state) const
protected

Increases the state by one, i.e. switches the state array to the consequent configuration.

This function is used in exact inference / decoding

Parameters
stateArray of nNodes elements with the current configuration (states destributed along the nodes)

Definition at line 49 of file DecodeExact.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setState()

void DirectGraphicalModels::CDecodeExact::setState ( vec_byte_t &  state,
qword  configuration 
) const
protected

Sets the state according to the configuration index configuration.

This function is used in exact inference / decoding

Parameters
stateArray of nNodes elements with the current configuration (states destributed along the nodes)
configurationConfiguration index \(\in[0; nStates^{nNodes}]\)

Definition at line 39 of file DecodeExact.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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