MUQ  0.4.3
ConcatenatingInterpolation.h
Go to the documentation of this file.
1 #ifndef CONCATENATINGINTERPOLATION_H_
2 #define CONCATENATINGINTERPOLATION_H_
3 
6 
7 namespace muq {
8  namespace SamplingAlgorithms {
9 
17  public:
18  ConcatenatingInterpolation(std::shared_ptr<muq::Utilities::MultiIndex> const& index) : index(index) {
19  }
20 
21  virtual std::shared_ptr<SamplingState> Interpolate (std::shared_ptr<SamplingState> const& coarseProposal, std::shared_ptr<SamplingState> const& fineProposal) override {
22  int fine_part_size = fineProposal->state[0].size() - coarseProposal->state[0].size();
23 
24  Eigen::VectorXd interpolatedState(fineProposal->state[0].size());
25  interpolatedState << coarseProposal->state[0], fineProposal->state[0].tail(fine_part_size);
26 
27  return std::make_shared<SamplingState>(interpolatedState);
28  }
29 
30  private:
31  std::shared_ptr<muq::Utilities::MultiIndex> index;
32  };
33 
34  }
35 }
36 
37 
38 #endif
A simple implementation concatenating coarse and fine sample vectors.
virtual std::shared_ptr< SamplingState > Interpolate(std::shared_ptr< SamplingState > const &coarseProposal, std::shared_ptr< SamplingState > const &fineProposal) override
std::shared_ptr< muq::Utilities::MultiIndex > index
ConcatenatingInterpolation(std::shared_ptr< muq::Utilities::MultiIndex > const &index)
Interpolation interface combining coarse and fine samples.