CVR-Lib last update 20 Sep 2009

cvr::labelAdjacencyMap::labelAdjacencyMap::graph Class Reference

This auxiliary class stores a simple adjacency graph between labels, in which only the edges between the nodes contain data. More...

#include <cvrLabelAdjacencyMap.h>

List of all members.

Public Types

typedef std::map< int, int > edges_type
typedef std::map< int, edges_typenodes_type

Public Member Functions

 graph ()
void acc (const int row, const int col)
void clear ()
int findMaxId () const
int findMinId () const
void findMinMaxIds (int &minRow, int &maxRow) const


Detailed Description

This auxiliary class stores a simple adjacency graph between labels, in which only the edges between the nodes contain data.

It uses std::map to store in a memory friendly way a sparse "adjacency" matrix.

In principle, only the "neighbors_" attribute of the class could also be used as "graph" representation, but this class allows for some common tasks with that container structure.


Member Typedef Documentation

typedef std::map<int,int> cvr::labelAdjacencyMap::labelAdjacencyMap::graph::edges_type

Each node in nodes_ has a "list" of ids of the neighbors of that node.

There exist therefore an edge for each element in a list of this type.

typedef std::map<int, edges_type > cvr::labelAdjacencyMap::labelAdjacencyMap::graph::nodes_type

Double hash for the neighbors.


Constructor & Destructor Documentation

cvr::labelAdjacencyMap::labelAdjacencyMap::graph::graph (  ) 

Construct an empty graph.


Member Function Documentation

void cvr::labelAdjacencyMap::labelAdjacencyMap::graph::acc ( const int  row,
const int  col 
)

Increment the value stored in the edge between the nodes identified by row and col.

If you visualize the graph as a matrix, this increments the element at (row,col).

void cvr::labelAdjacencyMap::labelAdjacencyMap::graph::clear (  ) 

Remove all data of graph.

int cvr::labelAdjacencyMap::labelAdjacencyMap::graph::findMaxId (  )  const

Find the largest row id used.

int cvr::labelAdjacencyMap::labelAdjacencyMap::graph::findMinId (  )  const

Find the largest row id used.

void cvr::labelAdjacencyMap::labelAdjacencyMap::graph::findMinMaxIds ( int &  minRow,
int &  maxRow 
) const

Find the largest row id used.


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

Generated on Sun Sep 20 22:08:48 2009 for CVR-Lib by Doxygen 1.5.8