MUQ  0.4.3
GeneralUtilitiesWrapper.cpp
Go to the documentation of this file.
1 #include "AllClassWrappers.h"
2 
6 
7 #include <pybind11/pybind11.h>
8 #include <pybind11/stl.h>
9 #include <pybind11/eigen.h>
10 
11 #include <string>
12 
13 #include <functional>
14 #include <vector>
15 
16 using namespace muq::Utilities::PythonBindings;
17 namespace py = pybind11;
18 
20 {
21  py::class_<RandomGenerator, std::shared_ptr<RandomGenerator>> randGen(m, "RandomGenerator");
22  randGen
23  //.def_static("GetNormal", (double (RandomGenerator::*)()) &RandomGenerator::GetNormal)
24  .def_static("GetNormal", (double (*)()) &RandomGenerator::GetNormal)
25  .def_static("GetNormal", (Eigen::MatrixXd (*)(int)) &RandomGenerator::GetNormal)
26  .def_static("GetNormal", (Eigen::MatrixXd (*)(int, int)) &RandomGenerator::GetNormal)
27 
28  .def_static("GetUniform", (double (*)()) &RandomGenerator::GetUniform)
29  .def_static("GetUniform", (Eigen::MatrixXd (*)(int)) &RandomGenerator::GetUniform)
30  .def_static("GetUniform", (Eigen::MatrixXd (*)(int, int)) &RandomGenerator::GetUniform)
31 
32  .def_static("GetGamma", (double (*)(double const, double const)) &RandomGenerator::GetGamma)
33  .def_static("GetGamma", (Eigen::MatrixXd (*)(double const, double const, int)) &RandomGenerator::GetGamma)
34  .def_static("GetGamma", (Eigen::MatrixXd (*)(double const, double const, int, int)) &RandomGenerator::GetGamma)
35 
36  .def_static("GetUniformInt", (int (*)(int, int)) &RandomGenerator::GetUniformInt)
37  .def_static("GetUniformInt", (Eigen::MatrixXi (*)(int, int, int)) &RandomGenerator::GetUniformInt)
38  .def_static("GetUniformInt", (Eigen::MatrixXi (*)(int, int, int, bool)) &RandomGenerator::GetUniformInt)
39  .def_static("GetUniformInt", (Eigen::MatrixXi (*)(int, int, int, int)) &RandomGenerator::GetUniformInt)
40  .def_static("GetUniformInt", (Eigen::MatrixXi (*)(int, int, int, int, bool)) &RandomGenerator::GetUniformInt)
41 
42  .def_static("SetSeed", &RandomGenerator::SetSeed)
43  .def_static("CopyGenerator", &RandomGenerator::CopyGenerator)
44  .def_static("SetGenerator", &RandomGenerator::SetGenerator);
45 }
static void SetGenerator(GeneratorType)
Set the state of the generator, designed for use with CopyGenerator. Be very careful in using this,...
static GeneratorType CopyGenerator()
Store a copy of the generator, designed for use with SetGenerator. Be very careful in using this,...
static void SetSeed(int seedval)
Set the seed for the random number generator. This is a fairly low quality way to do this,...
static double GetGamma(double const alpha, double const beta)
static int GetUniformInt(int lb, int ub)
void GeneralUtilitiesWrapper(pybind11::module &m)