Computes static Smolyak quadrature rules for multivariate integration. More...
#include <SmolyakQuadrature.h>
Computes static Smolyak quadrature rules for multivariate integration.
Definition at line 16 of file SmolyakQuadrature.h.
Public Member Functions | |
SmolyakQuadrature (unsigned int dim, std::shared_ptr< Quadrature > const &scalarRule) | |
SmolyakQuadrature (std::vector< std::shared_ptr< Quadrature >> const &scalarRulesIn) | |
virtual | ~SmolyakQuadrature ()=default |
virtual void | Compute (unsigned int order) override |
virtual void | Compute (Eigen::RowVectorXi const &orders) override |
virtual void | Compute (std::shared_ptr< muq::Utilities::MultiIndexSet > const &multis) |
std::shared_ptr< muq::Utilities::MultiIndexSet > | BuildMultis (Eigen::RowVectorXi const &orders) const |
Public Member Functions inherited from muq::Approximation::Quadrature | |
Quadrature (unsigned int dimIn) | |
virtual | ~Quadrature ()=default |
virtual unsigned int | Exactness (unsigned int quadOrder) const |
virtual unsigned int | Dim () const |
virtual Eigen::MatrixXd const & | Points () const |
virtual Eigen::VectorXd const & | Weights () const |
Static Public Member Functions | |
static Eigen::VectorXd | ComputeWeights (std::shared_ptr< muq::Utilities::MultiIndexSet > const &multis) |
static void | UpdateWeights (unsigned int activeInd, std::shared_ptr< muq::Utilities::MultiIndexSet > const &multis, Eigen::VectorXd &multiWeights) |
SmolyakQuadrature::SmolyakQuadrature | ( | unsigned int | dim, |
std::shared_ptr< Quadrature > const & | scalarRule | ||
) |
Definition at line 13 of file SmolyakQuadrature.cpp.
SmolyakQuadrature::SmolyakQuadrature | ( | std::vector< std::shared_ptr< Quadrature >> const & | scalarRulesIn | ) |
Definition at line 16 of file SmolyakQuadrature.cpp.
|
virtualdefault |
std::shared_ptr< MultiIndexSet > SmolyakQuadrature::BuildMultis | ( | Eigen::RowVectorXi const & | orders | ) | const |
Definition at line 36 of file SmolyakQuadrature.cpp.
References muq::Approximation::Quadrature::dim.
Referenced by Compute().
|
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 26 of file SmolyakQuadrature.cpp.
References BuildMultis(), and Compute().
|
virtual |
Definition at line 58 of file SmolyakQuadrature.cpp.
References ComputeWeights(), muq::Approximation::Quadrature::dim, muq::Approximation::Quadrature::pts, scalarRules, and muq::Approximation::Quadrature::wts.
|
overridevirtual |
Implements muq::Approximation::Quadrature.
Definition at line 21 of file SmolyakQuadrature.cpp.
References muq::Approximation::Quadrature::dim.
Referenced by Compute().
|
static |
The Smolyak rule is defined as the tensor product of differences of 1d quadrature rules
\[ \sum_{\mathbf{k}\in\mathcal{K}} \Delta_{k_1}^{(1)} \otimes \cdots \otimes \Delta^{(d)}_{k_d}, \]
where \(\Delta_{n}^{(i)} = \mathscr{L}_{n}^{(i)} - \mathscr{L}_{n-1}^{(i)}\). Computationally however, it is easier to work directly with tensor products of the quadrature rules themselves. Rearranging the above tensor product, we have an expansion of the form
\[ \sum_{\mathbf{k}\in\mathcal{K}} c_{\mathbf{k}} \mathscr{L}_{k_1}^{(i)} \otimes \mathscr{L}_{k_d}^{(d)}. \]
This function returns the weights \(c_{\mathbf{k}}\) and is called during the call the SmolyakQuadrature::Compute().
Definition at line 143 of file SmolyakQuadrature.cpp.
References UpdateWeights().
Referenced by Compute().
|
static |
Definition at line 112 of file SmolyakQuadrature.cpp.
References muq::Approximation::Quadrature::dim, and nlohmann::detail::dtoa_impl::k.
Referenced by ComputeWeights().
|
private |
Definition at line 57 of file SmolyakQuadrature.h.
Referenced by Compute().