MUQ  0.4.3
MCKernel.cpp
Go to the documentation of this file.
2 
3 namespace pt = boost::property_tree;
4 using namespace muq::Modeling;
5 using namespace muq::SamplingAlgorithms;
6 
8 
9 MCKernel::MCKernel(pt::ptree const& pt, std::shared_ptr<SamplingProblem> problem) : TransitionKernel(pt, problem) {}
10 
11 std::vector<std::shared_ptr<SamplingState>> MCKernel::Step(std::shared_ptr<SamplingState> prevState)
12 {
13  const boost::any newState = problem->GetDistribution()->Sample(prevState->state);
14  return std::vector<std::shared_ptr<SamplingState>>(1,std::make_shared<SamplingState>(newState, 1.0));
15 }
REGISTER_TRANSITION_KERNEL(MCKernel) MCKernel
Definition: MCKernel.cpp:7
Monte Carlo transition kernel.
Definition: MCKernel.h:12
Defines the transition kernel used by an MCMC algorithm.
std::shared_ptr< AbstractSamplingProblem > problem
The sampling problem that evaluates/samples the target distribution.