Skip to content
Snippets Groups Projects
Unverified Commit 6e5ecf7e authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #141 from jcarpent/devel

core: add setter for seed of the random generator
parents c2608e84 0cb83f18
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment