jacobi.qbk 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. [/
  2. Copyright 2019, Nick Thompson
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:jacobi Jacobi Polynomials]
  8. [h4 Synopsis]
  9. ``
  10. #include <boost/math/special_functions/jacobi.hpp>
  11. ``
  12. namespace boost{ namespace math{
  13. template<typename Real>
  14. Real jacobi(unsigned n, Real alpha, Real beta, Real x);
  15. template<typename Real>
  16. Real jacobi_derivative(unsigned n, Real alpha, Real beta, Real x, unsigned k);
  17. template<typename Real>
  18. Real jacobi_prime(unsigned n, Real alpha, Real beta, Real x);
  19. template<typename Real>
  20. Real jacobi_double_prime(unsigned n, Real alpha, Real beta, Real x);
  21. }} // namespaces
  22. Jacobi polynomials are a family of orthogonal polynomials.
  23. A basic usage is as follows:
  24. using boost::math::jacobi;
  25. double x = 0.5;
  26. double alpha = 0.3;
  27. double beta = 7.2;
  28. unsigned n = 3;
  29. double y = jacobi(n, alpha, beta, x);
  30. All derivatives of the Jacobi polynomials are available.
  31. The /k/-th derivative of the /n/-th Gegenbauer polynomial is given by
  32. using boost::math::jacobi_derivative;
  33. double x = 0.5;
  34. double alpha = 0.3;
  35. double beta = 7.2;
  36. unsigned n = 3;
  37. double y = jacobi_derivative(n, alpha, beta, x, k);
  38. For consistency with the rest of the library, `jacobi_prime` is provided which simply returns `jacobi_derivative(n, lambda, x,1)`.
  39. [$../graphs/jacobi.svg]
  40. [h3 Implementation]
  41. The implementation uses the 3-term recurrence for the Jacobi polynomials, rising.
  42. [endsect]