6 #include <boost/math/constants/constants.hpp>
16 template<
typename precision>
20 if (this->num_nodes < 2) {
21 throw invalid_argument(
"Clenshaw-Curtis quadrature requires at least two quadrature nodes.");
27 template<
typename precision>
33 template<
typename precision>
39 template<
typename precision>
42 this->nodes = vector<precision>(this->num_nodes, precision(0.0));
45 for (
size_t j = 0; j < this->num_nodes; j++) {
46 this->nodes[j] = 0.5 * (1.0 - cos(j * pi<precision>() / (this->num_nodes - 1)));
virtual bool right_is_node() const override
Interface for quadrature handlers.
Quadrature handler for Clenshaw-Curtis quadrature.
static Polynomial< CoeffT > legendre(const size_t order)
Computes the Legendre polynomial of given order.
virtual void compute_weights()
virtual bool left_is_node() const override
virtual void compute_nodes() override