wrap mt19937_64
parent
eb35ff8df6
commit
0d70a47571
|
@ -10,3 +10,15 @@
|
||||||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python,
|
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python,
|
||||||
* and saves one copy operation.
|
* and saves one copy operation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Custom Pybind11 module for the Mersenne-Twister PRNG object
|
||||||
|
* `std::mt19937_64`.
|
||||||
|
* This can be invoked with `gtsam.MT19937()` and passed
|
||||||
|
* wherever a rng pointer is expected.
|
||||||
|
*/
|
||||||
|
#include <random>
|
||||||
|
py::class_<std::mt19937_64>(m_, "MT19937")
|
||||||
|
.def(py::init<>())
|
||||||
|
.def(py::init<std::mt19937_64::result_type>())
|
||||||
|
.def("__call__", &std::mt19937_64::operator());
|
||||||
|
|
Loading…
Reference in New Issue