Commit 4c0774cb authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Python] add method vectorToEigenArray in python-definition

parent 08e9b9d0
......@@ -45,5 +45,16 @@ T_Point vectorFromEigenVector(const PointList& vector) {
}
return res;
}
template <typename T_point, typename PointList>
PointList vectorToEigenArray(const T_point& vect) {
const size_t nCols = vect.size();
const size_t nRows = vect[0].rows();
PointList res(nRows,nCols);
for (size_t i = 0; i < vect.size(); ++i) {
res.block(0,i,nRows,1) = vect[i];
}
return res;
}
} // namespace curves
#endif //_DEFINITION_PYTHON_BINDINGS
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