3 namespace pt = boost::property_tree;
7 TransitionKernel::TransitionKernel(pt::ptree
const& pt,
8 std::shared_ptr<AbstractSamplingProblem> problem) : blockInd(pt.
get(
"BlockIndex",0)),
10 reeval(pt.
get<bool>(
"ReevaluateAcceptedDensity", false)) {}
15 static std::shared_ptr<TransitionKernelMap> map;
19 map = std::make_shared<TransitionKernelMap>();
28 const std::string& kernelName = pt.get<std::string>(
"Method");
32 auto iter = kernelMap->find(kernelName);
33 if(iter == kernelMap->end()){
34 std::cerr <<
"ERROR: Could not find Transition Kernel \"" << kernelName <<
"\", available types are:\n";
36 for(
auto it=kernelMap->begin(); it!=kernelMap->end(); ++it)
37 std::cerr <<
" " << it->first << std::endl;
38 std::cerr << std::endl;
40 assert(iter != kernelMap->end());
44 return iter->second(pt,
problem);
std::shared_ptr< parcer::Communicator > comm
static std::shared_ptr< TransitionKernel > Construct(boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem)
Static constructor for the transition kernel.
std::shared_ptr< AbstractSamplingProblem > problem
The sampling problem that evaluates/samples the target distribution.
virtual void SetCommunicator(std::shared_ptr< parcer::Communicator > newcomm)
static std::shared_ptr< TransitionKernelMap > GetTransitionKernelMap()
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())