diff --git a/python/gtsam/specializations/gtsam.h b/python/gtsam/specializations/gtsam.h index da8842eaf..d15a8fa11 100644 --- a/python/gtsam/specializations/gtsam.h +++ b/python/gtsam/specializations/gtsam.h @@ -10,3 +10,15 @@ * with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, * 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 +py::class_(m_, "MT19937") + .def(py::init<>()) + .def(py::init()) + .def("__call__", &std::mt19937_64::operator());