MUQ  0.4.3
KLWrapper.cpp
Go to the documentation of this file.
1 #include "AllClassWrappers.h"
2 
4 
5 #include <pybind11/pybind11.h>
6 #include <pybind11/stl.h>
7 #include <pybind11/eigen.h>
8 
9 #include <string>
10 
11 #include <functional>
12 #include <vector>
13 
15 
16 using namespace muq::Utilities;
18 using namespace muq::Approximation;
19 namespace py = pybind11;
20 
22 {
23  // KarhunenLoeveExpansion class
24  py::class_<KarhunenLoeveExpansion, std::shared_ptr<KarhunenLoeveExpansion>>
25  KLExpansion(m, "KarhunenLoeveExpansion");
26  KLExpansion
27  .def(py::init<std::shared_ptr<KernelBase>, Eigen::MatrixXd const&,
28  Eigen::VectorXd const&>())
29  .def(py::init( [](std::shared_ptr<KernelBase> const& kern, Eigen::MatrixXd const& pts,
30  Eigen::VectorXd const& wts, py::dict const& d) { return new KarhunenLoeveExpansion(kern, pts, wts, ConvertDictToPtree(d)); } ))
31  .def("GetModes", &KarhunenLoeveExpansion::GetModes)
32  .def("Evaluate", &KarhunenLoeveExpansion::Evaluate);
33 }
Used to compute and evaluate the Karhunen-Loeve decomposition of a zero mean Gaussian process....
void KLWrapper(pybind11::module &m)
boost::property_tree::ptree ConvertDictToPtree(pybind11::dict dict)