Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
4c0774cb
Commit
4c0774cb
authored
Jan 23, 2020
by
Pierre Fernbach
Browse files
[Python] add method vectorToEigenArray in python-definition
parent
08e9b9d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/curves/python_definitions.h
View file @
4c0774cb
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment