1[section:legendre_stieltjes Legendre-Stieltjes Polynomials] 2 3[h4 Synopsis] 4 5 `` 6 #include <boost/math/special_functions/legendre_stieltjes.hpp> 7 `` 8 9 namespace boost{ namespace math{ 10 11 template <class T> 12 class legendre_stieltjes 13 { 14 public: 15 legendre_stieltjes(size_t m); 16 17 Real norm_sq() const; 18 19 Real operator()(Real x) const; 20 21 Real prime(Real x) const; 22 23 std::vector<Real> zeros() const; 24 } 25 26 }} 27 28[h4 Description] 29 30The Legendre-Stieltjes polynomials are a family of polynomials used to generate Gauss-Konrod quadrature formulas. 31Gauss-Konrod quadratures are algorithms which extend a Gaussian quadrature in such a way that all abscissas 32are reused when computed a higher-order estimate of the integral, allowing efficient calculation of an error estimate. 33The Legendre-Stieltjes polynomials assist with this task because their zeros /interlace/ the zeros of the Legendre polynomials, 34meaning that between any two zeros of a Legendre polynomial of degree n, there exists a zero of the Legendre-Stieltjes polynomial 35of degree n+1. 36 37The Legendre-Stieltjes polynomials ['E[sub n+1]] are defined by the property that they have /n/ vanishing moments against the oscillatory measure ['P[sub n]], i.e., 38 39[expression [int] [sub -1][super 1] E[sub n+1](x)P[sub n](x) x[super k]dx = 0] for /k = 0, 1, ..., n/. 40 41The first few are 42 43[expression E[sub 1](x) = P[sub 1](x)] 44 45[expression E[sub 2](x) = P[sub 2](x) - 2P[sub 0](x)/5] 46 47[expression E[sub 3](x) = P[sub 3](x) - 9P[sub 1](x)/14] 48 49[expression E[sub 4](x) = P[sub 4](x) - 20P[sub 2](x)/27 + 14P[sub 0](x)/891] 50 51[expression E[sub 5](x) = P[sub 5](x) - 35P[sub 3](x)/44 + 135P[sub 1](x)/12584] 52 53where ['P[sub i]] are the Legendre polynomials. 54The scaling follows [@http://www.ams.org/journals/mcom/1968-22-104/S0025-5718-68-99866-9/S0025-5718-68-99866-9.pdf Patterson], 55who expanded the Legendre-Stieltjes polynomials in a Legendre series and took the coefficient of the highest-order Legendre polynomial in the series to be unity. 56 57The Legendre-Stieltjes polynomials do not satisfy three-term recurrence relations or have a particularly simple representation. 58Hence the constructor call determines what, in fact, the polynomial is. 59Once the constructor comes back, the polynomial can be evaluated via the Legendre series. 60 61Example usage: 62 63 // Call to the constructor determines the coefficients in the Legendre expansion 64 legendre_stieltjes<double> E(12); 65 // Evaluate the polynomial at a point: 66 double x = E(0.3); 67 // Evaluate the derivative at a point: 68 double x_p = E.prime(0.3); 69 // Use the norm_sq to change between scalings, if desired: 70 double norm = std::sqrt(E.norm_sq()); 71 72[endsect] [/section:legendre_stieltjes Legendre-Stieltjes Polynomials] 73 74[/ 75 Copyright 2017 Nick Thompson 76 Distributed under the Boost Software License, Version 1.0. 77 (See accompanying file LICENSE_1_0.txt or copy at 78 http://www.boost.org/LICENSE_1_0.txt). 79] 80