MUQ  0.4.3
muq::SamplingAlgorithms::DummyKernel Class Reference

MCMC kernel that always accepts proposals. More...

#include <DummyKernel.h>

Inheritance diagram for muq::SamplingAlgorithms::DummyKernel:

Detailed Description

MCMC kernel that always accepts proposals.

This kernel simply accepts any proposal. It can be used to turn a MCMC method into a simple Monte Carlo method with the proposal density as its parameter distribution.

Definition at line 17 of file DummyKernel.h.

Public Member Functions

 DummyKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< MCMCProposal > proposal)
 
 ~DummyKernel ()
 
virtual std::shared_ptr< MCMCProposalProposal ()
 
virtual void PostStep (unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &state) override
 Allow the kernel to adapt given a new state. More...
 
virtual void PrintStatus (std::string prefix) const override
 
virtual std::vector< std::shared_ptr< SamplingState > > Step (unsigned int const t, std::shared_ptr< SamplingState > prevState) override
 
- Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel
 TransitionKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem)
 
virtual ~TransitionKernel ()=default
 
virtual void SetCommunicator (std::shared_ptr< parcer::Communicator > newcomm)
 
virtual void PreStep (unsigned int const t, std::shared_ptr< SamplingState > state)
 Allow the kernel to preprocess the current step. More...
 
virtual void PrintStatus () const
 
virtual void SetBlockInd (int newBlockInd)
 
virtual int GetBlockInd () const
 
virtual std::shared_ptr< AbstractSamplingProblem > const & Problem () const
 

Additional Inherited Members

- Public Types inherited from muq::SamplingAlgorithms::TransitionKernel
typedef boost::function< std::shared_ptr< TransitionKernel >boost::property_tree::ptree, std::shared_ptr< AbstractSamplingProblem >)> TransitionKernelConstructor
 
typedef std::map< std::string, TransitionKernelConstructorTransitionKernelMap
 
- Static Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel
static std::shared_ptr< TransitionKernelConstruct (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem)
 Static constructor for the transition kernel. More...
 
static std::shared_ptr< TransitionKernelMapGetTransitionKernelMap ()
 

Constructor & Destructor Documentation

◆ DummyKernel()

DummyKernel::DummyKernel ( boost::property_tree::ptree const &  pt,
std::shared_ptr< AbstractSamplingProblem problem,
std::shared_ptr< MCMCProposal proposal 
)

Definition at line 13 of file DummyKernel.cpp.

◆ ~DummyKernel()

DummyKernel::~DummyKernel ( )

Definition at line 21 of file DummyKernel.cpp.

Member Function Documentation

◆ PostStep()

void DummyKernel::PostStep ( unsigned int const  t,
std::vector< std::shared_ptr< SamplingState >> const &  state 
)
overridevirtual

Allow the kernel to adapt given a new state.

By default this function does nothing but children can override it to adapt the kernel

Parameters
[in]tThe current step
[in]stateThe current state

Reimplemented from muq::SamplingAlgorithms::TransitionKernel.

Definition at line 23 of file DummyKernel.cpp.

References proposal.

◆ PrintStatus()

void DummyKernel::PrintStatus ( std::string  prefix) const
overridevirtual

Reimplemented from muq::SamplingAlgorithms::TransitionKernel.

Definition at line 42 of file DummyKernel.cpp.

References numCalls.

◆ Proposal()

virtual std::shared_ptr<MCMCProposal> muq::SamplingAlgorithms::DummyKernel::Proposal ( )
inlinevirtual

Definition at line 26 of file DummyKernel.h.

References proposal.

◆ Step()

std::vector< std::shared_ptr< SamplingState > > DummyKernel::Step ( unsigned int const  t,
std::shared_ptr< SamplingState prevState 
)
overridevirtual
Parameters
[in]tThe current step
[in]stateThe current state

Implements muq::SamplingAlgorithms::TransitionKernel.

Definition at line 27 of file DummyKernel.cpp.

References numCalls, muq::SamplingAlgorithms::TransitionKernel::problem, and proposal.

Member Data Documentation

◆ numCalls

unsigned int muq::SamplingAlgorithms::DummyKernel::numCalls = 0
protected

Definition at line 37 of file DummyKernel.h.

Referenced by PrintStatus(), and Step().

◆ proposal

std::shared_ptr<MCMCProposal> muq::SamplingAlgorithms::DummyKernel::proposal
protected

Definition at line 35 of file DummyKernel.h.

Referenced by PostStep(), Proposal(), and Step().


The documentation for this class was generated from the following files: