MUQ  0.4.3
muq::Approximation::ClenshawCurtisQuadrature Class Reference

1d Clenshaw Curtis rule More...

#include <ClenshawCurtisQuadrature.h>

Inheritance diagram for muq::Approximation::ClenshawCurtisQuadrature:

Detailed Description

1d Clenshaw Curtis rule

As discussed for the "CCN_RULE" at http://people.sc.fsu.edu/~jburkardt/cpp_src/ccn_rule/ccn_rule.html, The Clenshaw Curtis quadrature rule is only nested for certain orders, specifically, orders [1,3,5,9,17,33,...]. This class allows users to define a nested quadrature rule, where the index passed to Compute is computed to one of these nested orders, or a non-nested quadrature rule, where the order is just equal to the index. If a nested rule is desired (the defaul behavior), "true" should be passed to the constructor.

Construction of nested rule.

ClenshawCurtisQuadrature quad; // or equivalently quad(true)
// Compute a nested rule with index 3, which will have 9 points
unsigned int index = 3;
quad.Compute(index);
Eigen::MatrixXd pts = quad.Points();
Eigen::VectorXd wts = quad.Weights();

Construction of non-nested rule.

// Compute a nested rule with index 3, which will have 3+1 points
unsigned int index = 3;
quad.Compute(index);
Eigen::MatrixXd pts = quad.Points();
Eigen::VectorXd wts = quad.Weights();

Definition at line 46 of file ClenshawCurtisQuadrature.h.

Public Member Functions

 ClenshawCurtisQuadrature (bool nestedIn=true)
 
virtual ~ClenshawCurtisQuadrature ()=default
 
virtual void Compute (unsigned int index) 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 void Compute (Eigen::RowVectorXi const &orders)
 
virtual unsigned int Dim () const
 
virtual Eigen::MatrixXd const & Points () const
 
virtual Eigen::VectorXd const & Weights () const
 

Constructor & Destructor Documentation

◆ ClenshawCurtisQuadrature()

ClenshawCurtisQuadrature::ClenshawCurtisQuadrature ( bool  nestedIn = true)

Definition at line 6 of file ClenshawCurtisQuadrature.cpp.

◆ ~ClenshawCurtisQuadrature()

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

Member Function Documentation

◆ Compute()

void ClenshawCurtisQuadrature::Compute ( unsigned int  index)
overridevirtual

◆ Exactness()

unsigned int ClenshawCurtisQuadrature::Exactness ( unsigned int  quadOrder) const
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 9 of file ClenshawCurtisQuadrature.cpp.

References IndexToNumPoints().

◆ IndexToNumPoints()

unsigned int ClenshawCurtisQuadrature::IndexToNumPoints ( unsigned int  index) const
private

Definition at line 14 of file ClenshawCurtisQuadrature.cpp.

References nested.

Referenced by Compute(), and Exactness().

Member Data Documentation

◆ nested

const bool muq::Approximation::ClenshawCurtisQuadrature::nested
private

Definition at line 61 of file ClenshawCurtisQuadrature.h.

Referenced by IndexToNumPoints().

◆ pi

const double muq::Approximation::ClenshawCurtisQuadrature::pi = 3.14159265358979323846
private

Definition at line 62 of file ClenshawCurtisQuadrature.h.

Referenced by Compute().


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