Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / math / doc / html / math_toolkit / sf_poly / legendre_stieltjes.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Legendre-Stieltjes Polynomials</title>
5 <link rel="stylesheet" href="../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Math Toolkit 2.11.0">
8 <link rel="up" href="../sf_poly.html" title="Polynomials">
9 <link rel="prev" href="legendre.html" title="Legendre (and Associated) Polynomials">
10 <link rel="next" href="laguerre.html" title="Laguerre (and Associated) Polynomials">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="legendre.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../sf_poly.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="laguerre.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="math_toolkit.sf_poly.legendre_stieltjes"></a><a class="link" href="legendre_stieltjes.html" title="Legendre-Stieltjes Polynomials">Legendre-Stieltjes
28       Polynomials</a>
29 </h3></div></div></div>
30 <h5>
31 <a name="math_toolkit.sf_poly.legendre_stieltjes.h0"></a>
32         <span class="phrase"><a name="math_toolkit.sf_poly.legendre_stieltjes.synopsis"></a></span><a class="link" href="legendre_stieltjes.html#math_toolkit.sf_poly.legendre_stieltjes.synopsis">Synopsis</a>
33       </h5>
34 <pre class="programlisting">
35 #include &lt;boost/math/special_functions/legendre_stieltjes.hpp&gt;
36
37
38 <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
39
40 <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
41 <span class="keyword">class</span> <span class="identifier">legendre_stieltjes</span>
42 <span class="special">{</span>
43 <span class="keyword">public</span><span class="special">:</span>
44     <span class="identifier">legendre_stieltjes</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">m</span><span class="special">);</span>
45
46     <span class="identifier">Real</span> <span class="identifier">norm_sq</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
47
48     <span class="identifier">Real</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">Real</span> <span class="identifier">x</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
49
50     <span class="identifier">Real</span> <span class="identifier">prime</span><span class="special">(</span><span class="identifier">Real</span> <span class="identifier">x</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
51
52     <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">Real</span><span class="special">&gt;</span> <span class="identifier">zeros</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
53 <span class="special">}</span>
54
55 <span class="special">}}</span>
56 </pre>
57 <h5>
58 <a name="math_toolkit.sf_poly.legendre_stieltjes.h1"></a>
59         <span class="phrase"><a name="math_toolkit.sf_poly.legendre_stieltjes.description"></a></span><a class="link" href="legendre_stieltjes.html#math_toolkit.sf_poly.legendre_stieltjes.description">Description</a>
60       </h5>
61 <p>
62         The Legendre-Stieltjes polynomials are a family of polynomials used to generate
63         Gauss-Konrod quadrature formulas. Gauss-Konrod quadratures are algorithms
64         which extend a Gaussian quadrature in such a way that all abscissas are reused
65         when computed a higher-order estimate of the integral, allowing efficient
66         calculation of an error estimate. The Legendre-Stieltjes polynomials assist
67         with this task because their zeros <span class="emphasis"><em>interlace</em></span> the zeros
68         of the Legendre polynomials, meaning that between any two zeros of a Legendre
69         polynomial of degree n, there exists a zero of the Legendre-Stieltjes polynomial
70         of degree n+1.
71       </p>
72 <p>
73         The Legendre-Stieltjes polynomials <span class="emphasis"><em>E<sub>n+1</sub></em></span> are defined
74         by the property that they have <span class="emphasis"><em>n</em></span> vanishing moments against
75         the oscillatory measure <span class="emphasis"><em>P<sub>n</sub></em></span>, i.e.,
76       </p>
77 <div class="blockquote"><blockquote class="blockquote"><p>
78           <span class="serif_italic">&#8747; <sub>-1</sub><sup>1</sup> E<sub>n+1</sub>(x)P<sub>n</sub>(x) x<sup>k</sup>dx = 0</span>
79         </p></blockquote></div>
80 <p>
81         for <span class="emphasis"><em>k = 0, 1, ..., n</em></span>.
82       </p>
83 <p>
84         The first few are
85       </p>
86 <div class="blockquote"><blockquote class="blockquote"><p>
87           <span class="serif_italic">E<sub>1</sub>(x) = P<sub>1</sub>(x)</span>
88         </p></blockquote></div>
89 <div class="blockquote"><blockquote class="blockquote"><p>
90           <span class="serif_italic">E<sub>2</sub>(x) = P<sub>2</sub>(x) - 2P<sub>0</sub>(x)/5</span>
91         </p></blockquote></div>
92 <div class="blockquote"><blockquote class="blockquote"><p>
93           <span class="serif_italic">E<sub>3</sub>(x) = P<sub>3</sub>(x) - 9P<sub>1</sub>(x)/14</span>
94         </p></blockquote></div>
95 <div class="blockquote"><blockquote class="blockquote"><p>
96           <span class="serif_italic">E<sub>4</sub>(x) = P<sub>4</sub>(x) - 20P<sub>2</sub>(x)/27 + 14P<sub>0</sub>(x)/891</span>
97         </p></blockquote></div>
98 <div class="blockquote"><blockquote class="blockquote"><p>
99           <span class="serif_italic">E<sub>5</sub>(x) = P<sub>5</sub>(x) - 35P<sub>3</sub>(x)/44 + 135P<sub>1</sub>(x)/12584</span>
100         </p></blockquote></div>
101 <p>
102         where <span class="emphasis"><em>P<sub>i</sub></em></span> are the Legendre polynomials. The scaling follows
103         <a href="http://www.ams.org/journals/mcom/1968-22-104/S0025-5718-68-99866-9/S0025-5718-68-99866-9.pdf" target="_top">Patterson</a>,
104         who expanded the Legendre-Stieltjes polynomials in a Legendre series and
105         took the coefficient of the highest-order Legendre polynomial in the series
106         to be unity.
107       </p>
108 <p>
109         The Legendre-Stieltjes polynomials do not satisfy three-term recurrence relations
110         or have a particulary simple representation. Hence the constructor call determines
111         what, in fact, the polynomial is. Once the constructor comes back, the polynomial
112         can be evaluated via the Legendre series.
113       </p>
114 <p>
115         Example usage:
116       </p>
117 <pre class="programlisting"><span class="comment">// Call to the constructor determines the coefficients in the Legendre expansion</span>
118 <span class="identifier">legendre_stieltjes</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">E</span><span class="special">(</span><span class="number">12</span><span class="special">);</span>
119 <span class="comment">// Evaluate the polynomial at a point:</span>
120 <span class="keyword">double</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">E</span><span class="special">(</span><span class="number">0.3</span><span class="special">);</span>
121 <span class="comment">// Evaluate the derivative at a point:</span>
122 <span class="keyword">double</span> <span class="identifier">x_p</span> <span class="special">=</span> <span class="identifier">E</span><span class="special">.</span><span class="identifier">prime</span><span class="special">(</span><span class="number">0.3</span><span class="special">);</span>
123 <span class="comment">// Use the norm_sq to change between scalings, if desired:</span>
124 <span class="keyword">double</span> <span class="identifier">norm</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span><span class="identifier">E</span><span class="special">.</span><span class="identifier">norm_sq</span><span class="special">());</span>
125 </pre>
126 </div>
127 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
128 <td align="left"></td>
129 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2019 Nikhar
130       Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
131       Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
132       R&#229;de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
133       Daryle Walker and Xiaogang Zhang<p>
134         Distributed under the Boost Software License, Version 1.0. (See accompanying
135         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
136       </p>
137 </div></td>
138 </tr></table>
139 <hr>
140 <div class="spirit-nav">
141 <a accesskey="p" href="legendre.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../sf_poly.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="laguerre.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
142 </div>
143 </body>
144 </html>