32 case 14:
return 16385;
33 case 15:
return 32769;
35 std::stringstream msg;
36 msg <<
"Requested a nested Clenshaw-Curtis rule with index " << index <<
", which is not defined. "
37 <<
"The maximum nested index allowed is 15, which already has 32769 points. "
38 <<
"Do you really need more than that?" << std::endl;
40 throw std::runtime_error(msg.str());
53 pts.resize(1,numPoints);
54 wts.resize(numPoints);
62 for(
int i=0; i<numPoints; ++i)
63 pts(0,i) = std::cos(
double(numPoints-i-1) *
pi /
double(numPoints - 1));
67 pts((numPoints+1)/2-1) = 0.0;
68 pts(numPoints-1) = 1.0;
70 wts = Eigen::VectorXd::Ones(numPoints);
72 for(
int i=0; i<numPoints; ++i) {
73 double theta = double(i) *
pi / double(numPoints-1);
75 for(
int j=0; j<(numPoints-1)/2; ++j){
78 if(2*(j+1)==(numPoints-1)){
84 wts(i) -= b*std::cos(2.0*(j+1)*theta) / (4.0*std::pow(j+1,2) - 1);
88 wts(0) /= double(numPoints-1);
89 wts.segment(1,numPoints-2) *= 2.0/(numPoints-1);
90 wts(numPoints-1) /= double(numPoints-1);
virtual unsigned int Exactness(unsigned int quadOrder) const override
ClenshawCurtisQuadrature(bool nestedIn=true)
unsigned int IndexToNumPoints(unsigned int index) const
virtual void Compute(unsigned int index) override
Base class for multivariate quadrature rules. @detail An abstract class for computing nodes and weigh...