eigenpy.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2019, CNRS
3  * Copyright 2018-2023, INRIA
4  */
5 
6 #include "eigenpy/eigenpy.hpp"
7 
8 #include <stdlib.h>
9 
10 namespace eigenpy {
11 
12 void seed(unsigned int seed_value) { srand(seed_value); }
13 
14 void exposeMatrixBool();
15 void exposeMatrixInt();
16 void exposeMatrixLong();
17 void exposeMatrixFloat();
18 void exposeMatrixDouble();
20 
24 
25 void exposeNoneType();
26 
27 /* Enable Eigen-Numpy serialization for a set of standard MatrixBase instances.
28  */
29 void enableEigenPy() {
30  using namespace Eigen;
31  import_numpy();
32 
34 
35  bp::def("sharedMemory", (void (*)(const bool))NumpyType::sharedMemory,
36  bp::arg("value"),
37  "Share the memory when converting from Eigen to Numpy.");
38 
39  bp::def("sharedMemory", (bool (*)())NumpyType::sharedMemory,
40  "Status of the shared memory when converting from Eigen to Numpy.\n"
41  "If True, the memory is shared when converting an Eigen::Matrix to a "
42  "numpy.array.\n"
43  "Otherwise, a deep copy of the Eigen::Matrix is performed.");
44 
45  bp::def("seed", &seed, bp::arg("seed_value"),
46  "Initialize the pseudo-random number generator with the argument "
47  "seed_value.");
48 
55 
59 
61 }
62 
64 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
65  return true;
66 #else
67  return false;
68 #endif
69 }
70 
71 } // namespace eigenpy
Eigen
Definition: complex.cpp:7
eigenpy::seed
void seed(unsigned int seed_value)
Definition: eigenpy.cpp:12
eigenpy::enableEigenPy
void EIGENPY_DLLAPI enableEigenPy()
Definition: eigenpy.cpp:29
eigenpy::exposeNoneType
void exposeNoneType()
Definition: optional.cpp:8
eigenpy::import_numpy
void EIGENPY_DLLAPI import_numpy()
Definition: numpy.cpp:8
eigenpy::exposeMatrixLong
void exposeMatrixLong()
Definition: matrix-long.cpp:8
eigenpy::Exception::registerException
static void registerException()
Definition: exception.cpp:21
eigenpy::NumpyType::sharedMemory
static bool sharedMemory()
Definition: numpy-type.cpp:32
eigenpy
Definition: alignment.hpp:14
eigenpy::exposeMatrixDouble
void exposeMatrixDouble()
Definition: matrix-double.cpp:8
eigenpy::exposeMatrixFloat
void exposeMatrixFloat()
Definition: matrix-float.cpp:8
eigenpy::exposeMatrixLongDouble
void exposeMatrixLongDouble()
Definition: matrix-long-double.cpp:8
eigenpy::withTensorSupport
bool EIGENPY_DLLAPI withTensorSupport()
Definition: eigenpy.cpp:63
eigenpy.hpp
eigenpy::exposeMatrixComplexFloat
void exposeMatrixComplexFloat()
Definition: matrix-complex-float.cpp:8
eigenpy::exposeMatrixComplexLongDouble
void exposeMatrixComplexLongDouble()
Definition: matrix-complex-long-double.cpp:8
eigenpy::exposeMatrixInt
void exposeMatrixInt()
Definition: matrix-int.cpp:8
eigenpy::exposeMatrixComplexDouble
void exposeMatrixComplexDouble()
Definition: matrix-complex-double.cpp:8
eigenpy::exposeMatrixBool
void exposeMatrixBool()
Definition: matrix-bool.cpp:8


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Tue Jan 23 2024 03:15:01