28 #ifndef TOMOGRAPHERPY_MHRW_H 29 #define TOMOGRAPHERPY_MHRW_H 33 #include <tomographerpy/common.h> 62 template<
typename MHWalkerParams>
65 static inline py::dict makeDict(
const MHWalkerParams & ) {
return {}; }
66 static inline MHWalkerParams fromPyObj(py::object ) {
return {}; }
69 template<
typename StepRealType>
73 return py::dict(py::arg(
"step_size") = p.step_size);
81 if ( py::hasattr(d,
"__getitem__") ) {
84 return d.attr(
"get")(
"step_size", 0).cast<StepRealType>();
87 return d.cast<StepRealType>();
94 template<
typename MHWalkerParams>
101 template<
typename MHWalkerParams>
Base namespace for the Tomographer project.
An MHWalkerParams type which just stores a step size.
C++ utility to convert a Python dictionary of fields into a valid C++ MHWalkerParams object...
py::dict pyMHWalkerParamsToDictInvoke(const MHWalkerParams &p)
Helper for converting any MHWalkerParams into a dictionary, using automatic template parameter deduct...
Tomographer::MHRWParams< py::object, IterCountIntType > MHRWParams
The Tomographer::MHRWParams type exposed to Python (the MHWalkerParam can be represented by any Pytho...
Specify the parameters of a Metropolis-Hastings random walk.
Routines for performing a Metropolis-Hastings random walk.
C++ Classes and Utilities for Python Modules.
MHWalkerParams pyMHWalkerParamsFromPyObj(py::object o)
Helper for converting any Python object into a given MHWalkerParams.