46 #ifndef PCL_RECOGNITION_ORR_GRAPH_H_
47 #define PCL_RECOGNITION_ORR_GRAPH_H_
55 template<
class NodeData>
71 inline const std::set<Node*>&
77 inline const NodeData&
130 for (
typename std::vector<Node*>::iterator nit =
nodes_.begin () ; nit !=
nodes_.end () ; ++nit )
143 for (
typename std::vector<Node*>::iterator nit =
nodes_.begin () ; nit !=
nodes_.end () ; ++nit )
146 nodes_.resize (static_cast<size_t> (n));
148 for (
int i = 0 ; i < n ; ++i )
155 std::vector<Node*> sorted_nodes (
nodes_.size ());
159 for (
typename std::vector<Node*>::iterator it =
nodes_.begin () ; it !=
nodes_.end () ; ++it )
161 sorted_nodes[i++] = *it;
166 std::sort (sorted_nodes.begin (), sorted_nodes.end (),
Node::compare);
169 for (
typename std::vector<Node*>::iterator it = sorted_nodes.begin () ; it != sorted_nodes.end () ; ++it )
179 for (
typename std::set<Node*>::iterator neigh = (*it)->neighbors_.begin () ; neigh != (*it)->neighbors_.end () ; ++neigh )
182 off_nodes.push_back (*neigh);
186 on_nodes.push_back (*it);
216 inline typename std::vector<Node*>&
const NodeData & getData() const
void insertUndirectedEdge(int id1, int id2)
void setData(const NodeData &data)
void deleteDirectedEdge(int id1, int id2)
std::set< Node * > neighbors_
std::vector< Node * > nodes_
std::vector< Node * > & getNodes()
void resize(int n)
Drops all existing graph nodes and creates 'n' new ones.
void setFitness(int fitness)
static bool compare(const Node *a, const Node *b)
void insertDirectedEdge(int id1, int id2)
void computeMaximalOnOffPartition(std::list< Node * > &on_nodes, std::list< Node * > &off_nodes)
const std::set< Node * > & getNeighbors() const
void deleteUndirectedEdge(int id1, int id2)