Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
0cb83f18
Verified
Commit
0cb83f18
authored
Dec 18, 2019
by
Justin Carpentier
Browse files
core: add setter for seed of the random generator
parent
c2608e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/eigenpy.cpp
View file @
0cb83f18
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment