1 #include "AllClassWrappers.h"
12 #include <pybind11/pybind11.h>
13 #include <pybind11/stl.h>
14 #include <pybind11/eigen.h>
31 py::class_<PolynomialChaosExpansion, BasisExpansion, std::shared_ptr<PolynomialChaosExpansion>> pce(m,
"PolynomialChaosExpansion");
33 .def(py::init<std::shared_ptr<OrthogonalPolynomial>
const&, std::shared_ptr<muq::Utilities::MultiIndexSet>
const&, Eigen::MatrixXd
const&>())
34 .def(py::init<std::shared_ptr<OrthogonalPolynomial>
const&, std::shared_ptr<muq::Utilities::MultiIndexSet>
const&,
unsigned int >())
35 .def(py::init<std::vector<std::shared_ptr<IndexedScalarBasis>>
const&, std::shared_ptr<muq::Utilities::MultiIndexSet>
const&, Eigen::MatrixXd
const&>())
36 .def(py::init<std::vector<std::shared_ptr<IndexedScalarBasis>>
const&, std::shared_ptr<muq::Utilities::MultiIndexSet>
const&,
unsigned int>())
50 py::class_<PCEFactory, std::shared_ptr<PCEFactory>> pceFactory(m,
"PCEFactory");
52 .def(py::init<std::vector<std::shared_ptr<Quadrature>>
const&, std::vector<std::shared_ptr<IndexedScalarBasis>>
const&>())
53 .def(py::init<std::vector<std::shared_ptr<Quadrature>>
const&, std::shared_ptr<muq::Utilities::MultiIndex>
const&,std::vector<std::shared_ptr<IndexedScalarBasis>>
const&>())
54 .def(py::init<std::vector<std::shared_ptr<Quadrature>>
const&, std::shared_ptr<muq::Utilities::MultiIndex>
const&, std::vector<std::shared_ptr<IndexedScalarBasis>>
const&,std::shared_ptr<muq::Utilities::MultiIndexSet>
const&>())
55 .def(
"Compute", (std::shared_ptr<PolynomialChaosExpansion>(
PCEFactory::*)(std::vector<Eigen::VectorXd>
const&, std::shared_ptr<MultiIndex>
const&) ) &
PCEFactory::Compute)
61 py::class_<AdaptiveSmolyakPCE, std::shared_ptr<AdaptiveSmolyakPCE>> adaptSmoly(m,
"AdaptiveSmolyakPCE");
63 .def(py::init<std::shared_ptr<muq::Modeling::ModPiece>, std::vector<std::shared_ptr<Quadrature>>,std::vector<std::shared_ptr<IndexedScalarBasis>>>())
65 std::shared_ptr<MultiIndexSet>
const& fixedSet,
68 .def(
"Error", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::Error)
69 .def(
"NumEvals", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::NumEvals)
70 .def(
"ErrorHistory", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::ErrorHistory)
71 .def(
"EvalHistory", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::EvalHistory)
72 .def(
"TimeHistory", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::TimeHistory)
73 .def(
"PointHistory", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::PointHistory)
74 .def(
"TermHistory", &
SmolyakEstimator<std::shared_ptr<PolynomialChaosExpansion>>::TermHistory);
Factory class for constructing a pseudo-spectral polynomial chaos approximation using a fixed quadrat...
std::vector< Eigen::VectorXd > const & QuadPts() const
std::shared_ptr< PolynomialChaosExpansion > Compute(std::shared_ptr< muq::Modeling::ModPiece > const &model)
A class for representing and using expansions of orthogonal multivariate polynomials.
static std::shared_ptr< PolynomialChaosExpansion > FromHDF5(std::string filename, std::string groupName="/")
Loads an expansion from an HDF5 file.
Eigen::MatrixXd Covariance() const
Eigen::VectorXd Mean() const
Eigen::VectorXd Variance() const
compute the variance of the current expansion
Eigen::VectorXd Magnitude() const
Compute the L2 norm of each output.
Eigen::MatrixXd TotalSensitivity() const
Compute all Sobol total sensitivities. Rows are outputs, each column is an input.
virtual void ToHDF5(muq::Utilities::H5Object &group) const override
Write PCE to HDF5 file.
Eigen::MatrixXd MainSensitivity() const
Eigen::VectorXd SobolSensitivity(unsigned int targetDim) const
Compute the main sensitivity index for the input dimension, for each output dimension.
void PolynomialChaosWrapper(pybind11::module &m)
boost::property_tree::ptree ConvertDictToPtree(pybind11::dict dict)