Skip to content
Snippets Groups Projects
Verified Commit d6539ff6 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

lib: expose the new switching features

parent 637b9bb9
No related branches found
No related tags found
No related merge requests found
/* /*
* 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 instances. */
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment