1 #ifndef PERIODICKERNEL_H
2 #define PERIODICKERNEL_H
9 namespace Approximation
21 class PeriodicKernel :
public KernelImpl<PeriodicKernel>
26 PeriodicKernel(
unsigned dim,
27 std::vector<unsigned> dimInds,
28 const double sigma2In,
29 const double lengthIn,
30 const double periodIn) : PeriodicKernel(dim,
35 {0.0, std::numeric_limits<double>::infinity()},
36 {1
e-10, std::numeric_limits<double>::infinity()},
37 {1
e-10, std::numeric_limits<double>::infinity()}){};
39 PeriodicKernel(
unsigned dim,
40 std::vector<unsigned> dimInds,
41 const double sigma2In,
42 const double lengthIn,
43 const double periodIn,
44 const Eigen::Vector2d sigmaBounds,
45 const Eigen::Vector2d lengthBounds,
46 const Eigen::Vector2d periodBounds);
49 PeriodicKernel(
unsigned dim,
50 const double sigma2In,
51 const double lengthIn,
52 const double periodIn) : PeriodicKernel(dim,
56 {0.0, std::numeric_limits<double>::infinity()},
57 {1
e-10, std::numeric_limits<double>::infinity()},
58 {1
e-10, std::numeric_limits<double>::infinity()}){};
60 PeriodicKernel(
unsigned dim,
61 const double sigma2In,
62 const double lengthIn,
63 const double periodIn,
64 const Eigen::Vector2d sigmaBounds,
65 const Eigen::Vector2d lengthBounds,
66 const Eigen::Vector2d periodBounds);
69 virtual ~PeriodicKernel(){};
71 template<
typename ScalarType1,
typename ScalarType2,
typename ScalarType3>
72 void FillBlockImpl(Eigen::Ref<
const Eigen::Matrix<ScalarType1, Eigen::Dynamic, 1>>
const& x1,
73 Eigen::Ref<
const Eigen::Matrix<ScalarType1, Eigen::Dynamic, 1>>
const& x2,
74 Eigen::Ref<
const Eigen::Matrix<ScalarType2, Eigen::Dynamic, 1>>
const& params,
75 Eigen::Ref<Eigen::Matrix<ScalarType3,Eigen::Dynamic, Eigen::Dynamic>> block)
const
77 ScalarType1 dist = (x1-x2).norm();
78 block(0,0) = params(0) * exp(-2.0 * pow(sin(pi*dist/params(2)),2.0) / pow(params(1),2.0));
82 virtual std::tuple<std::shared_ptr<muq::Modeling::LinearSDE>, std::shared_ptr<muq::Modeling::LinearOperator>, Eigen::MatrixXd> GetStateSpace(boost::property_tree::ptree sdeOptions = boost::property_tree::ptree())
const override;
85 const double pi = 4.0 * atan(1.0);
87 void SetupBounds(Eigen::Vector2d
const& sigmaBounds,
88 Eigen::Vector2d
const& lengthBounds,
89 Eigen::Vector2d
const& periodBounds);