Commit 0c0ab4e4 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Reimplement PathVector::reverse.

parent 5d4786c9
......@@ -136,6 +136,9 @@ namespace hpp {
/// that there is no PathVector in the PathVector.
void flatten (PathVectorPtr_t flattenedPath) const;
/// Reversion of a path
virtual PathPtr_t reverse () const;
protected:
/// Print path in a stream
virtual std::ostream& print (std::ostream &os) const;
......
......@@ -213,6 +213,16 @@ namespace hpp {
return path;
}
PathPtr_t PathVector::reverse () const
{
assert(!timeParameterization());
PathVectorPtr_t ret = create (outputSize (), outputDerivativeSize ());
std::for_each (paths_.rbegin(), paths_.rend(), [&ret](const PathPtr_t& path) {
ret->appendPath(path->reverse());
});
return ret;
}
std::ostream& PathVector::print (std::ostream &os) const
{
Path::print (os << "PathVector:") << incendl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment