38 const std::string& vertexTag,
int level,
40 : _optimizer(optimizer), _vertexTag(vertexTag), _level(level), _step(
step) {
61 int depth = (int)distance;
67 parentStar->
_gauge.insert(vParent);
73 if (depth && !(depth %
_step)) {
83 VertexStarMap::iterator it =
_vsMap.find(v);
87 _vsMap.insert(make_pair(v, s));
88 _vsMmap.insert(make_pair(v, s));
94 VertexStarMap::iterator it =
_vsMap.find(v);
95 if (it ==
_vsMap.end())
return 0;
101 HyperGraph::EdgeSet::iterator it =
_freeEdges.find(e);
105 for (
size_t i = 0; i < e->
vertices().size(); i++) {
static Factory * instance()
return the instance
const std::string & tag(const HyperGraph::HyperGraphElement *v) const
return the TAG given a vertex
const VertexContainer & vertices() const
abstract Vertex, your types must derive from that one
const EdgeSet & edges() const
int level() const
returns the level of the edge
A general case Vertex for optimization.
Star * getStar(HyperGraph::Vertex *v)
VertexStarMultimap _vsMmap
SparseOptimizer * _optimizer
BackBoneTreeAction(SparseOptimizer *optimizer, const std::string &vertexTag, int level, int step)
virtual double perform(HyperGraph::Vertex *v, HyperGraph::Vertex *vParent, HyperGraph::Edge *e, double distance)
bool fillStar(Star *s, HyperGraph::Edge *e_)
helper function that adds to a star an edge and all its vertices
void addToMap(Star *s, HyperGraph::Vertex *v)
void init()
initializes the visit and clears the internal structures
HyperGraph::EdgeSet _freeEdges
HyperGraph::VertexSet _lowLevelVertices
vertices that are fixed (center of the star)
HyperGraph::VertexSet _gauge
vertices that are fixed (center of the star)
HyperGraph::EdgeSet _lowLevelEdges
edges in the lower level