g2o
Loading...
Searching...
No Matches
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 (const std::string &edgeTag, const std::string &vertexTag, int level)
 
virtual double operator() (HyperGraph::Edge *e_, HyperGraph::Vertex *from, HyperGraph::Vertex *to)
 cost operator
 
- 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 44 of file edge_types_cost_function.h.

Constructor & Destructor Documentation

◆ EdgeTypesCostFunction()

g2o::EdgeTypesCostFunction::EdgeTypesCostFunction ( const std::string &  edgeTag,
const 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 35 of file edge_types_cost_function.cpp.

38 : _edgeTag(edgeTag),
39 _vertexTag(vertexTag),
41 _level(level) {}
static Factory * instance()
return the instance
Definition factory.cpp:46

Member Function Documentation

◆ operator()()

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

cost operator

Implements g2o::HyperDijkstra::CostFunction.

Definition at line 43 of file edge_types_cost_function.cpp.

45 {
46 OptimizableGraph::Edge* e = (OptimizableGraph::Edge*)(e_);
47 if (e->level() == _level && _factory->tag(e) == _edgeTag &&
48 _factory->tag(from) == _vertexTag && _factory->tag(to) == _vertexTag) {
49 return 1.;
50 }
51 return std::numeric_limits<double>::max();
52}
const std::string & tag(const HyperGraph::HyperGraphElement *v) const
return the TAG given a vertex
Definition factory.cpp:138

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

Member Data Documentation

◆ _edgeTag

std::string g2o::EdgeTypesCostFunction::_edgeTag

Definition at line 57 of file edge_types_cost_function.h.

Referenced by operator()().

◆ _factory

Factory* g2o::EdgeTypesCostFunction::_factory

Definition at line 59 of file edge_types_cost_function.h.

Referenced by operator()().

◆ _level

int g2o::EdgeTypesCostFunction::_level

Definition at line 60 of file edge_types_cost_function.h.

Referenced by operator()().

◆ _vertexTag

std::string g2o::EdgeTypesCostFunction::_vertexTag

Definition at line 58 of file edge_types_cost_function.h.

Referenced by operator()().


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