3 namespace pt = boost::property_tree;
7 MCMCProposal::MCMCProposal(boost::property_tree::ptree
const& pt,
8 std::shared_ptr<AbstractSamplingProblem>
const& probIn) : blockInd(pt.
get(
"BlockIndex",0)),
13 std::shared_ptr<AbstractSamplingProblem>
const& prob) {
16 std::string proposalName = pt.get<std::string>(
"Method");
19 auto iter = proposalMap->find(proposalName);
21 if(iter == proposalMap->end()){
22 std::cerr <<
"ERROR: Could not find MCMC proposal \"" << proposalName <<
"\". Available options are:\n";
24 for(
auto it=proposalMap->begin(); it!=proposalMap->end(); ++it)
25 std::cerr <<
" " << it->first << std::endl;
26 std::cerr << std::endl;
28 assert(iter!=proposalMap->end());
31 return iter->second(pt,
prob);
36 static std::shared_ptr<MCMCProposalMap> map;
40 map = std::make_shared<MCMCProposalMap>();
static std::shared_ptr< MCMCProposalMap > GetMCMCProposalMap()
std::shared_ptr< parcer::Communicator > comm
void SetCommunicator(std::shared_ptr< parcer::Communicator > newcomm)
std::shared_ptr< AbstractSamplingProblem > prob
static std::shared_ptr< MCMCProposal > Construct(boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > const &probIn)
Static constructor for the transition kernel.
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())