last update 20 Sep 2009 |
#include <cvrLabelAdjacencyMap.h>
Public Types | |
typedef std::map< int, int > | edges_type |
typedef std::map< int, edges_type > | nodes_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 |
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.
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.
cvr::labelAdjacencyMap::labelAdjacencyMap::graph::graph | ( | ) |
Construct an empty graph.
void cvr::labelAdjacencyMap::labelAdjacencyMap::graph::acc | ( | const int | row, | |
const int | 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.