legendre_stieltjes.qbk 2.9 KB

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