Verified Commit d6539ff6 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

lib: expose the new switching features

parent 637b9bb9
/*
* 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 instances. */
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);
......
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