g2o
Public Member Functions | Public Attributes | List of all members
g2o::EdgeTypesCostFunction Struct Reference

#include <edge_types_cost_function.h>

Inheritance diagram for g2o::EdgeTypesCostFunction:
Inheritance graph
[legend]
Collaboration diagram for g2o::EdgeTypesCostFunction:
Collaboration graph
[legend]

Public Member Functions

 EdgeTypesCostFunction (std::string edgeTag, std::string vertexTag, int level)
 
virtual double operator() (HyperGraph::Edge *e_, HyperGraph::Vertex *from, HyperGraph::Vertex *to)
 cost operator More...
 
- Public Member Functions inherited from g2o::HyperDijkstra::CostFunction
virtual ~CostFunction ()
 

Public Attributes

std::string _edgeTag
 
std::string _vertexTag
 
Factory_factory
 
int _level
 

Detailed Description

Cost function for Hyper-Dijkstra that returns 1 when for edges that belong to a given type and maxdouble otherwise. It can be used to construct a backbone of a hierarchical graph by running Dijkstra.

Definition at line 15 of file edge_types_cost_function.h.

Constructor & Destructor Documentation

g2o::EdgeTypesCostFunction::EdgeTypesCostFunction ( std::string  edgeTag,
std::string  vertexTag,
int  level 
)

creates a cost function that matches edges at a given level, whose tag is the one given and that are leaving/leading to vertices of a selected type.

Parameters
edgeTagthe tag of the edge type to consider
vertexTagthe tag of the vertex to consider
levelthe level of the edge

Definition at line 7 of file edge_types_cost_function.cpp.

7  :
8  _edgeTag(edgeTag),
9  _vertexTag(vertexTag),
11  _level(level)
12  {}
static Factory * instance()
return the instance
Definition: factory.cpp:61

Member Function Documentation

double g2o::EdgeTypesCostFunction::operator() ( HyperGraph::Edge e_,
HyperGraph::Vertex from,
HyperGraph::Vertex to 
)
virtual

cost operator

Implements g2o::HyperDijkstra::CostFunction.

Definition at line 14 of file edge_types_cost_function.cpp.

References _edgeTag, _factory, _level, _vertexTag, g2o::OptimizableGraph::Edge::level(), and g2o::Factory::tag().

14  {
16  if (e->level()==_level && _factory->tag(e)==_edgeTag && _factory->tag(from)==_vertexTag && _factory->tag(to)==_vertexTag) {
17  return 1.;
18  }
19  return std::numeric_limits<double>::max();
20  }
const std::string & tag(const HyperGraph::HyperGraphElement *v) const
return the TAG given a vertex
Definition: factory.cpp:157
class G2O_CORE_API Edge

Member Data Documentation

std::string g2o::EdgeTypesCostFunction::_edgeTag

Definition at line 26 of file edge_types_cost_function.h.

Referenced by operator()().

Factory* g2o::EdgeTypesCostFunction::_factory

Definition at line 28 of file edge_types_cost_function.h.

Referenced by operator()().

int g2o::EdgeTypesCostFunction::_level

Definition at line 29 of file edge_types_cost_function.h.

Referenced by operator()().

std::string g2o::EdgeTypesCostFunction::_vertexTag

Definition at line 27 of file edge_types_cost_function.h.

Referenced by operator()().


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