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

◆ gegenbauer

auto eve::gegenbauer = functor<gegenbauer_t>
inlineconstexpr

Defined in header

#include <eve/module/polynomial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto gegenbauer(integral_value auto n, floating_value auto lambda,
floating_value auto x) noexcept; //1
// Lanes masking
constexpr auto gegenbauer[conditional_expr auto c](integral_value auto n, floating_value auto lambda,
floating_value auto x) noexcept; // 2
constexpr auto gegenbauer[logical_value auto m](integral_value auto n, floating_value auto lambda,
floating_value auto x) 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:134
constexpr auto gegenbauer
strict_elementwise_callable object computing the value of a gegenbauer polynomial .
Definition gegenbauer.hpp:95
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. The value of \( \mathbf{C}_n^\lambda(x)\) is returned.

    The Gegenbauer polynomials are a sequence of orthogonal polynomials relative to \((1-x^2)^{\lambda-1/2}\) on the \([-1, +1]\) interval satisfying the following recurrence relation:

    • \( \mathbf{C}_0^\lambda(x) = 1\).
    • \( \mathbf{C}_1^\lambda(x) = 2\lambda x\).
    • \( \mathbf{C}_n^\lambda(x) = \left[(2x+\lambda-1)\mathbf{C}_{n-1}^\lambda(x) - (n+2\lambda-2)\mathbf{C}_{n-2}^\lambda(x)\right]/n\).
  2. The operation is performed conditionally.

External references

Example

// revision 1
#include <eve/module/polynomial.hpp>
#include <iostream>
int main()
{
eve::wide xd{0.5, -1.5, 0.1, -1.0, 19.0, 25.0, 21.5, 10000.0};
eve::wide n{0, 1, 2, 3, 4, 5, 6, 7};
double l(-3.0/8.0);
std::cout << "<- xd = " << xd << "\n";
std::cout << "<- n = " << n << "\n";
std::cout << "<- l = " << l << "\n";
std::cout << "-> gegenbauer(n, l, xd) = " << eve::gegenbauer(n, l, xd) << '\n';
std::cout << "-> gegenbauer[ignore_last(2)](n, l, xd)= " << eve::gegenbauer[eve::ignore_last(2)](n, l, xd) << '\n';
std::cout << "-> gegenbauer[n > 3](n, l, xd) = " << eve::gegenbauer[n > 3](n, l, xd) << '\n';
std::cout << "-> gegenbauer(3, l, xd) = " << eve::gegenbauer(3, l, xd) << '\n';
std::cout << "-> gegenbauer(n, l, 0.3) = " << eve::gegenbauer(n, l, 0.3) << '\n';
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:361
Wrapper for SIMD registers.
Definition wide.hpp:94