diff --git a/src/eigenpy.cpp b/src/eigenpy.cpp index aafe0ef8487c926c4bbfe86e5a2dd3853e6bfee8..efdb99733619852fb8813d5609f113f1a44982c6 100644 --- a/src/eigenpy.cpp +++ b/src/eigenpy.cpp @@ -4,10 +4,16 @@ */ #include "eigenpy/eigenpy.hpp" +#include <stdlib.h> namespace eigenpy { + void seed(unsigned int seed_value) + { + srand(seed_value); + } + /* Enable Eigen-Numpy serialization for a set of standard MatrixBase instances. */ void enableEigenPy() { @@ -27,6 +33,9 @@ namespace eigenpy bp::def("switchToNumpyMatrix",&NumpyType::switchToNumpyMatrix, "Set the conversion from Eigen::Matrix to numpy.matrix."); + + bp::def("seed",&seed,bp::arg("seed_value"), + "Initialize the pseudo-random number generator with the argument seed_value."); ENABLE_SPECIFIC_MATRIX_TYPE(Matrix2d); ENABLE_SPECIFIC_MATRIX_TYPE(Matrix2f);