Newer
Older
#include "eigenpy/eigenpy.hpp"
namespace eigenpy
{
void seed(unsigned int seed_value)
{
srand(seed_value);
}
void exposeMatrixInt();
void exposeMatrixLong();
void exposeMatrixFloat();
void exposeMatrixDouble();
void exposeMatrixLongDouble();
void exposeMatrixComplexFloat();
void exposeMatrixComplexDouble();
void exposeMatrixComplexLongDouble();
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instances. */
void enableEigenPy()
{
using namespace Eigen;
Exception::registerException();
bp::def("setNumpyType",&NumpyType::setNumpyType,
"Change the Numpy type returned by the converters from an Eigen object.");
bp::def("getNumpyType",&NumpyType::getNumpyType,
"Get the Numpy type returned by the converters from an Eigen object.");
bp::def("switchToNumpyArray",&NumpyType::switchToNumpyArray,
"Set the conversion from Eigen::Matrix to numpy.ndarray.");
bp::def("switchToNumpyMatrix",&NumpyType::switchToNumpyMatrix,
"Set the conversion from Eigen::Matrix to numpy.matrix.");
Justin Carpentier
committed
bp::def("sharedMemory",
(void (*)(const bool))NumpyType::sharedMemory,
bp::arg("value"),
"Share the memory when converting from Eigen to Numpy.");
Justin Carpentier
committed
bp::def("sharedMemory",
(bool (*)())NumpyType::sharedMemory,
"Status of the shared memory when converting from Eigen to Numpy.\n"
Justin Carpentier
committed
"If True, the memory is shared when converting an Eigen::Matrix to a numpy.array.\n"
"Otherwise, a deep copy of the Eigen::Matrix is performed.");
Justin Carpentier
committed
bp::def("seed",&seed,bp::arg("seed_value"),
"Initialize the pseudo-random number generator with the argument seed_value.");
exposeMatrixInt();
exposeMatrixLong();
exposeMatrixFloat();
exposeMatrixDouble();
exposeMatrixLongDouble();
exposeMatrixComplexFloat();
exposeMatrixComplexDouble();
exposeMatrixComplexLongDouble();
}
} // namespace eigenpy