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
Stack Of Tasks
eigenpy
Commits
d6539ff6
Verified
Commit
d6539ff6
authored
Oct 18, 2018
by
Justin Carpentier
Browse files
lib: expose the new switching features
parent
637b9bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/eigenpy.cpp
View file @
d6539ff6
/*
* Copyright (c) 2015-2018 LAAS-CNRS
* Copyright (c) 2015-2018 LAAS-CNRS
, INRIA
*
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
...
...
@@ -19,11 +19,21 @@
namespace
eigenpy
{
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance
s
. */
void
enableEigenPy
()
{
using
namespace
Eigen
;
Exception
::
registerException
();
bp
::
def
(
"setNumpyType"
,
&
PyMatrixType
::
setNumpyType
,
bp
::
arg
(
"Numpy type (np.ndarray or np.matrix)"
),
"Change the type returned by the converters from an Eigen object."
);
bp
::
def
(
"switchToNumpyArray"
,
&
PyMatrixType
::
switchToNumpyArray
,
"Set the conversion from Eigen::Matrix to numpy.ndarray."
);
bp
::
def
(
"switchToNumpyMatrix"
,
&
PyMatrixType
::
switchToNumpyMatrix
,
"Set the conversion from Eigen::Matrix to numpy.matrix."
);
ENABLE_SPECIFIC_MATRIX_TYPE
(
MatrixXd
);
ENABLE_SPECIFIC_MATRIX_TYPE
(
Matrix2d
);
...
...
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