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
6e5ecf7e
Unverified
Commit
6e5ecf7e
authored
Dec 18, 2019
by
Justin Carpentier
Committed by
GitHub
Dec 18, 2019
Browse files
Merge pull request #141 from jcarpent/devel
core: add setter for seed of the random generator
parents
c2608e84
0cb83f18
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/eigenpy.cpp
View file @
6e5ecf7e
...
...
@@ -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