E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ jacobi

auto eve::jacobi = functor<jacobi_t>
inlineconstexpr

Defined in header

#include <eve/module/polynomial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto jacobi(integral_value auto n, floating_value auto x,
floating_value auto alpha, floating_value auto beta) noexcept; // 1
// Lanes masking
constexpr auto jacobi[conditional_expr auto c](integral_value auto n, floating_value auto x,
floating_value auto alpha, floating_value auto beta) noexcept; // 2
constexpr auto jacobi[logical_value auto m](integral_value auto n, floating_value auto x,
floating_value auto alpha, floating_value auto beta) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
constexpr auto jacobi
strict_elementwise_callable object computing the value of the Jacobi polynomials .
Definition jacobi.hpp:91
constexpr auto beta
elementwise_callable object computing the beta function: .
Definition beta.hpp:76
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

The Jacobi polynomials are a sequence of orthogonal polynomials relative to \((1-x)^{\alpha}(1+x)^{\beta}\), for \(\alpha \) and \(\beta \) greater than -1, on the \([-1, +1]\) interval.

They can be defined via a Rodrigues formula: \(\displaystyle P^{\alpha, \beta}_n(x) = \frac{(-1)^n}{2^n n!}(1-x)^{-\alpha} (1+x)^{-\beta} \frac{d}{dx^n}\left\{ (1-x)^{\alpha}(1+x)^{\beta}(1-x^2)^n \right\}\).

  1. The value of the polynomial \(P^{\alpha, \beta}_n(x)\) is returned.
  2. The operation is performed conditionnaly.

External references

Example

#include <eve/module/polynomial.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft xd = {0.5, -1.5, 0.1, -1.0, 19.0, 25.0, 21.5, 10000.0};
wide_it n = {0, 1, 2, 3, 4, 5, 6, 7};
wide_ft x(0.5);
wide_ft aa{-0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0};
double a = -3/8.0;
double b = 0.25;
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- n = " << n << '\n'
<< "<- x = " << x << '\n'
<< "-> jacobi(n, a, b, xd) = " << eve::jacobi(n, a, b, xd) << '\n'
<< "-> jacobi(4, a, b, xd) = " << eve::jacobi(4, a, b, xd) << '\n'
<< "-> jacobi(4, a, b, x) = " << eve::jacobi(4, a, b, x) << '\n'
<< "-> jacobi(n, a, b 0.5) = " << eve::jacobi(n, a, b, 0.5) << '\n'
<< "-> jacobi(n, a, b, x) = " << eve::jacobi(n, a, b, x) << '\n'
<< "-> jacobi(n, aa, b, x) = " << eve::jacobi(n, aa, b, x) << '\n'
;
double xs = 0.5;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<< "-> jacobi(4, xs) = " << eve::jacobi(4, a, b, xs) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86