MUQ  0.4.3
AbstractSamplingProblem.h
Go to the documentation of this file.
1 #ifndef ABSTRACTSAMPLINGPROBLEM_H
2 #define ABSTRACTSAMPLINGPROBLEM_H
3 
4 #include <vector>
5 #include <assert.h>
6 
7 #include <memory>
8 
9 #include <Eigen/Core>
10 #include <boost/property_tree/ptree.hpp>
11 
12 namespace muq{
13  namespace SamplingAlgorithms{
14 
15  class SamplingState;
16 
30  {
31  public:
32 
33  AbstractSamplingProblem(Eigen::VectorXi const& blockSizesIn,
34  Eigen::VectorXi const& blockSizesQOIIn);
35 
36  AbstractSamplingProblem(Eigen::VectorXi const& blockSizesIn);
37 
38  virtual ~AbstractSamplingProblem() = default;
39 
40  virtual double LogDensity(std::shared_ptr<SamplingState> const& state) = 0;
41 
42  virtual std::shared_ptr<AbstractSamplingProblem> Clone() const{assert(false); return nullptr;};
43 
45  virtual Eigen::VectorXd GradLogDensity(std::shared_ptr<SamplingState> const& state,
46  unsigned const blockWrt);
47 
48 
49  virtual std::shared_ptr<SamplingState> QOI();
50 
51 
56  virtual void AddOptions(boost::property_tree::ptree & pt) const{};
57 
58  const int numBlocks;
59  const Eigen::VectorXi blockSizes;
60  const int numBlocksQOI;
61  const Eigen::VectorXi blockSizesQOI;
62  };
63 
64  }
65 }
66 
67 
68 #endif // ifndef ABSTRACTSAMPLINGPROBLEM_H
Abstract base class for MCMC and Importance Sampling problems.
virtual std::shared_ptr< SamplingState > QOI()
virtual void AddOptions(boost::property_tree::ptree &pt) const
AbstractSamplingProblem(Eigen::VectorXi const &blockSizesIn, Eigen::VectorXi const &blockSizesQOIIn)
virtual double LogDensity(std::shared_ptr< SamplingState > const &state)=0
virtual std::shared_ptr< AbstractSamplingProblem > Clone() const
virtual Eigen::VectorXd GradLogDensity(std::shared_ptr< SamplingState > const &state, unsigned const blockWrt)