Skip to content
Snippets Groups Projects
Commit 92e5f0d8 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add Node::getWeight

parent 5ed9eb97
No related branches found
No related tags found
No related merge requests found
...@@ -100,6 +100,8 @@ namespace hpp { ...@@ -100,6 +100,8 @@ namespace hpp {
void updateWeight (const EdgePtr_t&edge, const Weight_t& w); void updateWeight (const EdgePtr_t&edge, const Weight_t& w);
Weight_t getWeight (const EdgePtr_t&edge);
/// Constraint to project onto this node. /// Constraint to project onto this node.
ConstraintSetPtr_t configConstraint() const; ConstraintSetPtr_t configConstraint() const;
......
...@@ -137,6 +137,18 @@ namespace hpp { ...@@ -137,6 +137,18 @@ namespace hpp {
} }
hppDout (error, "Edge not found"); hppDout (error, "Edge not found");
} }
Weight_t Node::getWeight (const EdgePtr_t& e)
{
for (Neighbors_t::const_iterator it = neighbors_.begin();
it != neighbors_.end(); ++it)
if (it->second == e) return it->first;
for (std::vector<EdgePtr_t>::const_iterator it = hiddenNeighbors_.begin();
it != hiddenNeighbors_.end(); ++it)
if (*it == e) return -1;
hppDout (error, "Edge not found");
return 0;
}
} // namespace graph } // namespace graph
} // namespace manipulation } // namespace manipulation
} // namespace hpp } // namespace hpp
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment