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

Remove GraphOptimizer::unpack and use PathVector::flatten instead

parent 61ca215f
No related branches found
No related tags found
No related merge requests found
......@@ -71,11 +71,6 @@ namespace hpp {
/// The encapsulated PathOptimizer
PathOptimizerPtr_t pathOptimizer_;
/// Append all paths of in to out
/// \param in a path vector, possibly containing other path vector
/// \param out a flat PathVector (do not contain PathVector)
static void unpack (PathVectorPtr_t in, PathVectorPtr_t out);
};
/// \}
......
......@@ -31,7 +31,7 @@ namespace hpp {
GraphPathValidationPtr_t gpv = HPP_DYNAMIC_PTR_CAST (GraphPathValidation,
this->problem().pathValidation ());
const_cast <core::Problem&>(this->problem ()).pathValidation (gpv->innerValidation());
unpack (path, expanded);
path->flatten (expanded);
ConstraintSetPtr_t c;
for (std::size_t i_s = 0; i_s < expanded->numberPaths ();) {
PathVectorPtr_t toOpt = PathVector::create (
......@@ -58,18 +58,5 @@ namespace hpp {
const_cast <core::Problem&>(this->problem ()).pathValidation (gpv);
return opted;
}
void GraphOptimizer::unpack (PathVectorPtr_t in, PathVectorPtr_t out)
{
for (size_t i = 0; i != in->numberPaths (); i++) {
PathPtr_t current = in->pathAtRank (i);
PathVectorPtr_t pv = HPP_DYNAMIC_PTR_CAST (PathVector, current);
if (pv) {
unpack (pv, out);
} else {
out->appendPath (current);
}
}
}
} // namespace manipulation
} // 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