1d Clenshaw Curtis rule More...
#include <ClenshawCurtisQuadrature.h>
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.
Construction of non-nested rule.
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 |
ClenshawCurtisQuadrature::ClenshawCurtisQuadrature | ( | bool | nestedIn = true | ) |
Definition at line 6 of file ClenshawCurtisQuadrature.cpp.
|
virtualdefault |
|
overridevirtual |
Implements muq::Approximation::Quadrature.
Definition at line 49 of file ClenshawCurtisQuadrature.cpp.
References IndexToNumPoints(), pi, muq::Approximation::Quadrature::pts, and muq::Approximation::Quadrature::wts.
|
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().
|
private |
Definition at line 14 of file ClenshawCurtisQuadrature.cpp.
References nested.
Referenced by Compute(), and Exactness().
|
private |
Definition at line 61 of file ClenshawCurtisQuadrature.h.
Referenced by IndexToNumPoints().
|
private |
Definition at line 62 of file ClenshawCurtisQuadrature.h.
Referenced by Compute().