Multivariate quadrature rule defined by the tensor product of 1d rules. More...
#include <FullTensorQuadrature.h>
Multivariate quadrature rule defined by the tensor product of 1d rules.
One of the most straightforward multivariate quadrature rules, a full tensor expansion. Creates a the complete tensor product of the points of the given order 1D quadrature rules for each dimension. The 1D quadrature order can be isotropic or vary per dimension. Note that an isotropic order does not mean isotropic number of points in each dimension, if different 1D quadrature rules are used.
Probably not the most useful class for actual analysis, because you have to know exactly what order you want, but is an important building block for sparse quadrature routines.
Definition at line 28 of file FullTensorQuadrature.h.
Public Member Functions | |
FullTensorQuadrature (unsigned int dim, std::shared_ptr< Quadrature > const &rules) | |
FullTensorQuadrature (unsigned int dim, std::shared_ptr< Quadrature > const &rules, unsigned int order) | |
FullTensorQuadrature (std::vector< std::shared_ptr< Quadrature >> const &rules, Eigen::RowVectorXi orders=Eigen::RowVectorXi()) | |
virtual | ~FullTensorQuadrature ()=default |
virtual void | Compute (unsigned int order) override |
virtual void | Compute (Eigen::RowVectorXi const &orders) override |
virtual unsigned int | Exactness (unsigned int quadOrder) const override |
Public Member Functions inherited from muq::Approximation::Quadrature | |
Quadrature (unsigned int dimIn) | |
virtual | ~Quadrature ()=default |
virtual unsigned int | Dim () const |
virtual Eigen::MatrixXd const & | Points () const |
virtual Eigen::VectorXd const & | Weights () const |
FullTensorQuadrature::FullTensorQuadrature | ( | unsigned int | dim, |
std::shared_ptr< Quadrature > const & | rules | ||
) |
Sets up a tensor product of quadrature rules in dim dimensions. Does not compute the tensor product because no order is specified.
Definition at line 14 of file FullTensorQuadrature.cpp.
FullTensorQuadrature::FullTensorQuadrature | ( | unsigned int | dim, |
std::shared_ptr< Quadrature > const & | rules, | ||
unsigned int | order | ||
) |
Sets up and solves a tensor product of 1d quadrature rules.
Definition at line 9 of file FullTensorQuadrature.cpp.
FullTensorQuadrature::FullTensorQuadrature | ( | std::vector< std::shared_ptr< Quadrature >> const & | rules, |
Eigen::RowVectorXi | orders = Eigen::RowVectorXi() |
||
) |
Sets up a tensor product of quadrature rules with potentially different rules in each dimension. If the orders row vector is specified, then the tensor product rule is also computed, otherwise an additional call to "Compute" is required.
Definition at line 18 of file FullTensorQuadrature.cpp.
|
virtualdefault |
|
overridevirtual |
Base implementation of Compute. Assumes the quadrature rule is 1d and then calls Compute with the first component of the orders vector.
Multivariate quadrature rules should override this function.
Reimplemented from muq::Approximation::Quadrature.
Definition at line 37 of file FullTensorQuadrature.cpp.
References muq::Approximation::Quadrature::dim, muq::Approximation::Quadrature::pts, rules, and muq::Approximation::Quadrature::wts.
|
overridevirtual |
Implements muq::Approximation::Quadrature.
Definition at line 32 of file FullTensorQuadrature.cpp.
References muq::Approximation::Quadrature::dim.
Referenced by muq::Approximation::AdaptiveSmolyakQuadrature::ComputeOneTerm(), FullTensorQuadrature(), muq::Approximation::AdaptiveSmolyakQuadrature::OneTermPoints(), and muq::Approximation::PCEFactory::Setup().
|
overridevirtual |
Returns the order of the polynomial that can be integrated exactly by this quadrature rule. An \(n\)-point Gauss quadrature rule integrates polynomials of order \(2n-1\) exactly. Thus, since \(n\)= quadOrder+1, for Gauss quadrature rules, this function will return 2*quadOrder+1.
In the multivariate tensor product rule, the maximum exactness across all dimensions is returned.
If not exactness information is known (or implemented) for a particular quadrature rule, an exception will be thrown.
Reimplemented from muq::Approximation::Quadrature.
Definition at line 72 of file FullTensorQuadrature.cpp.
References rules.
|
private |
Definition at line 62 of file FullTensorQuadrature.h.
Referenced by Compute(), Exactness(), and FullTensorQuadrature().