Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
eigenpy
Commits
d6539ff6
Verified
Commit
d6539ff6
authored
6 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
lib: expose the new switching features
parent
637b9bb9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/eigenpy.cpp
+12
-2
12 additions, 2 deletions
src/eigenpy.cpp
with
12 additions
and
2 deletions
src/eigenpy.cpp
+
12
−
2
View file @
d6539ff6
/*
/*
* Copyright (c) 2015-2018 LAAS-CNRS
* Copyright (c) 2015-2018 LAAS-CNRS
, INRIA
*
*
* This file is part of eigenpy.
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
* eigenpy is free software: you can redistribute it and/or
...
@@ -19,11 +19,21 @@
...
@@ -19,11 +19,21 @@
namespace
eigenpy
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
()
void
enableEigenPy
()
{
{
using
namespace
Eigen
;
using
namespace
Eigen
;
Exception
::
registerException
();
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
(
MatrixXd
);
ENABLE_SPECIFIC_MATRIX_TYPE
(
Matrix2d
);
ENABLE_SPECIFIC_MATRIX_TYPE
(
Matrix2d
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment