Skip to content

Commit d6539ff

Browse files
committed
lib: expose the new switching features
1 parent 637b9bb commit d6539ff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/eigenpy.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2018 LAAS-CNRS
2+
* Copyright (c) 2015-2018 LAAS-CNRS, INRIA
33
*
44
* This file is part of eigenpy.
55
* eigenpy is free software: you can redistribute it and/or
@@ -19,11 +19,21 @@
1919
namespace eigenpy
2020
{
2121

22-
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */
22+
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instances. */
2323
void enableEigenPy()
2424
{
2525
using namespace Eigen;
2626
Exception::registerException();
27+
28+
bp::def("setNumpyType",&PyMatrixType::setNumpyType,
29+
bp::arg("Numpy type (np.ndarray or np.matrix)"),
30+
"Change the type returned by the converters from an Eigen object.");
31+
32+
bp::def("switchToNumpyArray",&PyMatrixType::switchToNumpyArray,
33+
"Set the conversion from Eigen::Matrix to numpy.ndarray.");
34+
35+
bp::def("switchToNumpyMatrix",&PyMatrixType::switchToNumpyMatrix,
36+
"Set the conversion from Eigen::Matrix to numpy.matrix.");
2737

2838
ENABLE_SPECIFIC_MATRIX_TYPE(MatrixXd);
2939
ENABLE_SPECIFIC_MATRIX_TYPE(Matrix2d);

0 commit comments

Comments
 (0)