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:132
constexpr auto gegenbauer
strict_elementwise_callable object computing the value of a gegenbauer polynomial .
Definition gegenbauer.hpp:95
EVE Main Namespace.
Definition abi.hpp:18

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 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.3);
wide_ft l(-3.0/8.0);
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- n = " << n << '\n'
<< "<- l = " << l << '\n'
<< "<- x = " << x << '\n'
<< "-> gegenbauer(n, l, xd) = " << eve::gegenbauer(n, l, xd) << '\n'
<< "-> gegenbauer(3, l, xd) = " << eve::gegenbauer(3, l, xd) << '\n'
<< "-> gegenbauer(n, l, 0.3) = " << eve::gegenbauer(n, l, 0.3) << '\n'
<< "-> gegenbauer(n, -3.0/8.0, 0.3) = " << eve::gegenbauer(n, -3.0/8.0, 0.3) << '\n'
<< "-> gegenbauer(n, l, x) = " << eve::gegenbauer(n, l, x) << '\n'
;
double xs = 3.0;
double ll = 0.1;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<< "<- ll = " << ll << '\n'
<< "-> gegenbauer(4, ll, xs) = " << eve::gegenbauer(4, ll, xs) << '\n'
;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:70