g2o
edge_types_cost_function.cpp
Go to the documentation of this file.
1 #include <limits>
2 #include "g2o/core/factory.h"
4 
5 namespace g2o {
6 
7  EdgeTypesCostFunction::EdgeTypesCostFunction(std::string edgeTag, std::string vertexTag, int level):
8  _edgeTag(edgeTag),
9  _vertexTag(vertexTag),
10  _factory(Factory::instance()),
11  _level(level)
12  {}
13 
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  }
21 
22 }
int level() const
returns the level of the edge
const std::string & tag(const HyperGraph::HyperGraphElement *v) const
return the TAG given a vertex
Definition: factory.cpp:157
create vertices and edges based on TAGs in, for example, a file
Definition: factory.h:49
abstract Vertex, your types must derive from that one
Definition: hyper_graph.h:142
virtual double operator()(HyperGraph::Edge *e_, HyperGraph::Vertex *from, HyperGraph::Vertex *to)
cost operator
EdgeTypesCostFunction(std::string edgeTag, std::string vertexTag, int level)