mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Documentation for Jacobi polynomials.
This commit is contained in:
52
doc/graphs/jacobi.svg
Normal file
52
doc/graphs/jacobi.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 42 KiB |
@@ -18,7 +18,7 @@
|
||||
[block '''</chapter>''']]
|
||||
|
||||
[/insert Equation as an image, previous generated with an external tool like Latex.]
|
||||
[template equation[name]
|
||||
[template equation[name]
|
||||
[:
|
||||
'''<inlinemediaobject>
|
||||
<imageobject role="html">
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
[/insert Graph as an SVG or PNG image, previous generated with an external tool like SVG_plot.]
|
||||
|
||||
[template graph[name]
|
||||
[template graph[name]
|
||||
[:
|
||||
'''<inlinemediaobject>
|
||||
<imageobject role="html">
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
[/insert Indented one-line expression italic and serif font probably using Unicode symbols for Greek and symbols.]
|
||||
[/Example: [expression [sub 1]F[sub 0](a, z) = (1-z)[super -a]]]
|
||||
[template expression[equation]
|
||||
[template expression[equation]
|
||||
[:
|
||||
[role serif_italic [equation]]
|
||||
]
|
||||
@@ -628,6 +628,7 @@ and as a CD ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22.
|
||||
[include sf/spherical_harmonic.qbk]
|
||||
[include sf/cardinal_b_splines.qbk]
|
||||
[include sf/gegenbauer.qbk]
|
||||
[include sf/jacobi.qbk]
|
||||
[endsect] [/section:sf_poly Polynomials]
|
||||
|
||||
[section:bessel Bessel Functions]
|
||||
|
||||
62
doc/sf/jacobi.qbk
Normal file
62
doc/sf/jacobi.qbk
Normal file
@@ -0,0 +1,62 @@
|
||||
[/
|
||||
Copyright 2019, Nick Thompson
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt).
|
||||
]
|
||||
|
||||
[section:jacobi Jacobi Polynomials]
|
||||
|
||||
[h4 Synopsis]
|
||||
|
||||
``
|
||||
#include <boost/math/special_functions/jacobi.hpp>
|
||||
``
|
||||
|
||||
namespace boost{ namespace math{
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi(unsigned n, Real alpha, Real beta, Real x);
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi_derivative(unsigned n, Real alpha, Real beta, Real x, unsigned k);
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi_prime(unsigned n, Real alpha, Real beta, Real x);
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi_double_prime(unsigned n, Real alpha, Real beta, Real x);
|
||||
|
||||
}} // namespaces
|
||||
|
||||
Jacobi polynomials are a family of orthogonal polynomials.
|
||||
|
||||
A basic usage is as follows:
|
||||
|
||||
using boost::math::jacobi;
|
||||
double x = 0.5;
|
||||
double alpha = 0.3;
|
||||
double beta = 7.2;
|
||||
unsigned n = 3;
|
||||
double y = jacobi(n, alpha, beta, x);
|
||||
|
||||
All derivatives of the Jacobi polynomials are available.
|
||||
The /k/-th derivative of the /n/-th Gegenbauer polynomial is given by
|
||||
|
||||
using boost::math::jacobi_derivative;
|
||||
double x = 0.5;
|
||||
double alpha = 0.3;
|
||||
double beta = 7.2;
|
||||
unsigned n = 3;
|
||||
double y = jacobi_derivative(n, alpha, beta, x, k);
|
||||
|
||||
For consistency with the rest of the library, `jacobi_prime` is provided which simply returns `jacobi_derivative(n, lambda, x,1)`.
|
||||
|
||||
[$../graphs/jacobi.svg]
|
||||
|
||||
[h3 Implementation]
|
||||
|
||||
The implementation uses the 3-term recurrence for the Jacobi polynomials, rising.
|
||||
|
||||
|
||||
[endsect]
|
||||
@@ -14,6 +14,8 @@ namespace boost { namespace math {
|
||||
template<typename Real>
|
||||
Real jacobi(unsigned n, Real alpha, Real beta, Real x)
|
||||
{
|
||||
static_assert(!std::is_integral<Real>::value, "Jacobi polynomials do not work with integer arguments.");
|
||||
|
||||
if (n == 0) {
|
||||
return Real(1);
|
||||
}
|
||||
@@ -51,5 +53,17 @@ Real jacobi_derivative(unsigned n, Real alpha, Real beta, Real x, unsigned k)
|
||||
return scale*jacobi<Real>(n-k, alpha + k, beta+k, x);
|
||||
}
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi_prime(unsigned n, Real alpha, Real beta, Real x)
|
||||
{
|
||||
return jacobi_derivative<Real>(n, alpha, beta, x, 1);
|
||||
}
|
||||
|
||||
template<typename Real>
|
||||
Real jacobi_double_prime(unsigned n, Real alpha, Real beta, Real x)
|
||||
{
|
||||
return jacobi_derivative<Real>(n, alpha, beta, x, 2);
|
||||
}
|
||||
|
||||
}}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user