MUQ  0.4.3
muq::Approximation::SmolyakQuadrature Class Reference

Computes static Smolyak quadrature rules for multivariate integration. More...

#include <SmolyakQuadrature.h>

Inheritance diagram for muq::Approximation::SmolyakQuadrature:

Detailed Description

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::MultiIndexSetBuildMultis (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)
 

Constructor & Destructor Documentation

◆ SmolyakQuadrature() [1/2]

SmolyakQuadrature::SmolyakQuadrature ( unsigned int  dim,
std::shared_ptr< Quadrature > const &  scalarRule 
)

Definition at line 13 of file SmolyakQuadrature.cpp.

◆ SmolyakQuadrature() [2/2]

SmolyakQuadrature::SmolyakQuadrature ( std::vector< std::shared_ptr< Quadrature >> const &  scalarRulesIn)

Definition at line 16 of file SmolyakQuadrature.cpp.

◆ ~SmolyakQuadrature()

virtual muq::Approximation::SmolyakQuadrature::~SmolyakQuadrature ( )
virtualdefault

Member Function Documentation

◆ BuildMultis()

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().

◆ Compute() [1/3]

void SmolyakQuadrature::Compute ( Eigen::RowVectorXi const &  orders)
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().

◆ Compute() [2/3]

void SmolyakQuadrature::Compute ( std::shared_ptr< muq::Utilities::MultiIndexSet > const &  multis)
virtual

◆ Compute() [3/3]

void SmolyakQuadrature::Compute ( unsigned int  order)
overridevirtual

Implements muq::Approximation::Quadrature.

Definition at line 21 of file SmolyakQuadrature.cpp.

References muq::Approximation::Quadrature::dim.

Referenced by Compute().

◆ ComputeWeights()

Eigen::VectorXd SmolyakQuadrature::ComputeWeights ( std::shared_ptr< muq::Utilities::MultiIndexSet > const &  multis)
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().

◆ UpdateWeights()

void SmolyakQuadrature::UpdateWeights ( unsigned int  activeInd,
std::shared_ptr< muq::Utilities::MultiIndexSet > const &  multis,
Eigen::VectorXd &  multiWeights 
)
static

Member Data Documentation

◆ scalarRules

std::vector<std::shared_ptr<Quadrature> > muq::Approximation::SmolyakQuadrature::scalarRules
private

Definition at line 57 of file SmolyakQuadrature.h.

Referenced by Compute().


The documentation for this class was generated from the following files: