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

Fully-connected (dense) graph class. More...

#include <GraphDense.h>

Inheritance diagram for DirectGraphicalModels::CGraphDense:
Collaboration diagram for DirectGraphicalModels::CGraphDense:

Public Member Functions

 CGraphDense (byte nStates)
 Constructor. More...
 
virtual ~CGraphDense (void)=default
 
void reset (void) override
 Resets the graph. More...
 
size_t addNode (const Mat &pot=EmptyMat) override
 Adds an additional node (with specified potentional) More...
 
void addNodes (const Mat &pots) override
 Adds the graph nodes with potentials. More...
 
void setNode (size_t node, const Mat &pot) override
 Sets or changes the potential of node. More...
 
void setNodes (size_t start_node, const Mat &pots) override
 Fills the graph nodes with new potentials. More...
 
void getNode (size_t node, Mat &pot) const override
 Returns the node potential. More...
 
void getNodes (size_t start_node, size_t num_nodes, Mat &pots) const override
 Returns the node potentials. More...
 
void getChildNodes (size_t node, vec_size_t &vNodes) const override
 Returns the set of IDs of the child nodes of the argument node. More...
 
void getParentNodes (size_t node, vec_size_t &vNodes) const override
 Returns the set of IDs of the parent nodes of the argument node. More...
 
size_t getNumNodes (void) const override
 Returns the number of nodes in the graph. More...
 
size_t getNumEdges (void) const override
 Returns the number of edges in the graph. More...
 
void addEdgeModel (const ptr_edgeModel_t &pEdgeModel)
 Adds an edge model. More...
 
Mat getNodePotentials (void) const
 Returns the container with node potentials. More...
 
std::vector< ptr_edgeModel_t > & getEdgeModels (void) const
 Returns the contener with edge models. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CGraph
 CGraph (byte nStates)
 Constructor. More...
 
 CGraph (const CGraph &)=delete
 
virtual ~CGraph (void)=default
 
const CGraphoperator= (const CGraph &)=delete
 
byte getNumStates (void) const
 Returns number of states (classes) More...
 

Private Attributes

Mat m_nodePotentials
 The container for the node potentials: Mat(nNodes, nStates, CV_32FC1), i.e. every row is a node potential vector. More...
 
std::vector< ptr_edgeModel_tm_vpEdgeModels
 The set of edge models. More...
 

Detailed Description

Fully-connected (dense) graph class.

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 15 of file GraphDense.h.

Constructor & Destructor Documentation

◆ CGraphDense()

DirectGraphicalModels::CGraphDense::CGraphDense ( byte  nStates)
inline

Constructor.

Parameters
nStatesthe number of States (classes)

Definition at line 22 of file GraphDense.h.

◆ ~CGraphDense()

virtual DirectGraphicalModels::CGraphDense::~CGraphDense ( void  )
virtualdefault

Member Function Documentation

◆ addEdgeModel()

void DirectGraphicalModels::CGraphDense::addEdgeModel ( const ptr_edgeModel_t pEdgeModel)
inline

Adds an edge model.

Dense CRF may have multiple edge models. All edge models will be subsequently applied during the iterations of the inference process.

Parameters
pEdgeModelPoiter to an dense edge model (ref. IEdgeModel)

Definition at line 49 of file GraphDense.h.

Here is the caller graph for this function:

◆ addNode()

size_t DirectGraphicalModels::CGraphDense::addNode ( const Mat &  pot = EmptyMat)
overridevirtual

Adds an additional node (with specified potentional)

Parameters
potnode potential vector: Mat(size: nStates x 1; type: CV_32FC1)
Returns
the node's ID

Implements DirectGraphicalModels::CGraph.

Definition at line 7 of file GraphDense.cpp.

Here is the call graph for this function:

◆ addNodes()

void DirectGraphicalModels::CGraphDense::addNodes ( const Mat &  pots)
inlineoverridevirtual

Adds the graph nodes with potentials.

Parameters
potsA block of potentials: Mat(size: nNodes x nStates; type: CV_32FC1)

Reimplemented from DirectGraphicalModels::CGraph.

Definition at line 29 of file GraphDense.h.

Here is the caller graph for this function:

◆ getChildNodes()

void DirectGraphicalModels::CGraphDense::getChildNodes ( size_t  node,
vec_size_t &  vNodes 
) const
overridevirtual

Returns the set of IDs of the child nodes of the argument node.

Parameters
[in]nodenode index
[out]vNodesvector with the child node's ID

Implements DirectGraphicalModels::CGraph.

Definition at line 56 of file GraphDense.cpp.

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

◆ getEdgeModels()

std::vector<ptr_edgeModel_t>& DirectGraphicalModels::CGraphDense::getEdgeModels ( void  ) const
inline

Returns the contener with edge models.

One edge model applies itself to all the edges in the graph

Returns
The container with edge models: vector of size: number of used edge models

Definition at line 60 of file GraphDense.h.

◆ getNode()

void DirectGraphicalModels::CGraphDense::getNode ( size_t  node,
Mat &  pot 
) const
overridevirtual

Returns the node potential.

Parameters
[in]nodenode index
[out]potnode potential vector: Mat(size: nStates x 1; type: CV_32FC1)

Implements DirectGraphicalModels::CGraph.

Definition at line 36 of file GraphDense.cpp.

Here is the call graph for this function:

◆ getNodePotentials()

Mat DirectGraphicalModels::CGraphDense::getNodePotentials ( void  ) const
inline

Returns the container with node potentials.

Returns
The container with node potentials: Mat(nNodes, nStates, CV_32FC1)

Definition at line 54 of file GraphDense.h.

Here is the caller graph for this function:

◆ getNodes()

void DirectGraphicalModels::CGraphDense::getNodes ( size_t  start_node,
size_t  num_nodes,
Mat &  pots 
) const
overridevirtual

Returns the node potentials.

This function supports PPL

Parameters
[in]start_nodeThe index of the node, starting from which the potentials should be got
[in]num_nodesThe number of nodes potentials to acquire. 0 means - read nodes from start_node till the last one.
[out]potsA block of potentials: Mat(size: num_nodes x nStates; type: CV_32FC1)

Reimplemented from DirectGraphicalModels::CGraph.

Definition at line 47 of file GraphDense.cpp.

Here is the call graph for this function:

◆ getNumEdges()

size_t DirectGraphicalModels::CGraphDense::getNumEdges ( void  ) const
inlineoverridevirtual

Returns the number of edges in the graph.

Returns
number of edges

Implements DirectGraphicalModels::CGraph.

Definition at line 41 of file GraphDense.h.

Here is the call graph for this function:

◆ getNumNodes()

size_t DirectGraphicalModels::CGraphDense::getNumNodes ( void  ) const
inlineoverridevirtual

Returns the number of nodes in the graph.

Returns
number of nodes

Implements DirectGraphicalModels::CGraph.

Definition at line 40 of file GraphDense.h.

Here is the caller graph for this function:

◆ getParentNodes()

void DirectGraphicalModels::CGraphDense::getParentNodes ( size_t  node,
vec_size_t &  vNodes 
) const
inlineoverridevirtual

Returns the set of IDs of the parent nodes of the argument node.

Parameters
[in]nodenode index
[out]vNodesvector with the parent node's ID

Implements DirectGraphicalModels::CGraph.

Definition at line 38 of file GraphDense.h.

Here is the call graph for this function:

◆ reset()

void DirectGraphicalModels::CGraphDense::reset ( void  )
inlineoverridevirtual

Resets the graph.

This function allows to re-use the graph or update node potential, while preserving the graph structure. It deletes all the nodes and edges and sets node index to zero.

Implements DirectGraphicalModels::CGraph.

Definition at line 26 of file GraphDense.h.

Here is the caller graph for this function:

◆ setNode()

void DirectGraphicalModels::CGraphDense::setNode ( size_t  node,
const Mat &  pot 
)
overridevirtual

Sets or changes the potential of node.

Parameters
nodenode index
potnode potential vector: Mat(size: nStates x 1; type: CV_32FC1)

Implements DirectGraphicalModels::CGraph.

Definition at line 15 of file GraphDense.cpp.

Here is the call graph for this function:

◆ setNodes()

void DirectGraphicalModels::CGraphDense::setNodes ( size_t  start_node,
const Mat &  pots 
)
overridevirtual

Fills the graph nodes with new potentials.

This function supports PPL

Parameters
start_nodeThe index of the node, starting from which the potentials should be set
potsA block of potentials: Mat(size: nNodes x nStates; type: CV_32FC1)

Reimplemented from DirectGraphicalModels::CGraph.

Definition at line 25 of file GraphDense.cpp.

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

Member Data Documentation

◆ m_nodePotentials

Mat DirectGraphicalModels::CGraphDense::m_nodePotentials
private

The container for the node potentials: Mat(nNodes, nStates, CV_32FC1), i.e. every row is a node potential vector.

Definition at line 64 of file GraphDense.h.

◆ m_vpEdgeModels

std::vector<ptr_edgeModel_t> DirectGraphicalModels::CGraphDense::m_vpEdgeModels
mutableprivate

The set of edge models.

Definition at line 65 of file GraphDense.h.


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