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

◆ laguerre

auto eve::laguerre = functor<laguerre_t>
inlineconstexpr
  • The Laguerre polynomial of order n is given by \(\displaystyle \mbox{L}_{n}(x) = \frac{e^x}{n!}\frac{d^n}{dx^n}(x^ne^{-x})\).
  • The associated laguerre polynomial is given by \(\displaystyle \mbox{L}_{n}^{m} = (-1)^m\frac{d^m}{dx^m}\mbox{L}_{n+m}(x)\).

Header file

#include <eve/module/polynomial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto laguerre(integral_value auto n, floating_value auto x) noexcept; //1
// Semantic options
constexpr auto laguerre[associated](integral_value auto n, integral_value auto m,
floating_value auto x) noexcept; // 2
constexpr auto laguerre[successor](integral_value auto n,
integral_value auto ln, integral_value auto lnm1) noexcept; // 3
constexpr auto laguerre[successor](integral_value auto n, integral_value auto l,
integral_value auto ln, integral_value auto lnm1) noexcept; // 3
constexpr auto laguerre[associated][successor](integral_value auto n,
integral_value auto m, floating_value auto x) noexcept; // 4
}
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
constexpr auto laguerre
strict_elementwise_callable object computing the value of the Laguerre and associated Laguerre polyno...
Definition laguerre.hpp:99
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. The value of the Laguerre polynomial of order n at x is returned.
  2. The value of the associated Laguerre polynomial of orders n, m at x is returned. constexpr auto legendre(integral_value auto n, floating_value auto x) noexcept; //1
  3. implements the three term recurrence relation for the Laguerre polynomials, \(\displaystyle \mbox{L}_{n+1} = \left((2n+1-x)\mbox{L}_{n}-n\mbox{L}_{n-1}\right)/(n+1)\)
  4. implements the three term recurrence relation for the associated Laguerre polynomials, \(\displaystyle \mbox{L}_{n+1}^m = \left((m+2n+1-x)\mbox{L}_{n}^{m}-(m+n)\mbox{L}_{n-1}^{m}\right)/(n+1)\)

External references

Example

// revision 1
#include <eve/module/polynomial.hpp>
#include <iostream>
int main()
{
eve::wide n{0, 1, 2, 3, 4, 5, 6, 7};
eve::wide m{0, 1, 2, 3, 4, 5, 6, 7};
eve::wide xd{0.5, -1.5, 0.1, -1.0, 19.0, 25.0, 21.5, 10000.0};
double x(0.5);
std::cout << "<- n = " << n << '\n';
std::cout << "<- m = " << m << '\n';
std::cout << "<- xd = " << xd << '\n';
std::cout << "<- x = " << x << '\n';
std::cout << "-> laguerre(n, xd) = " << eve::laguerre(n, xd) << '\n';
std::cout << "-> laguerre[ignore_last(2)](n, xd) = " << eve::laguerre[eve::ignore_last(2)](n, xd) << '\n';
std::cout << "-> laguerre[n > 3](n, xd) = " << eve::laguerre[n > 3](n, xd) << '\n';
std::cout << "-> laguerre(3, xd) = " << eve::laguerre(3, xd) << '\n';
std::cout << "-> laguerre(n, x) = " << eve::laguerre(n, x) << '\n';
std::cout << "-> laguerre[associated](n, m, xd) = " << eve::laguerre[eve::associated](n, m, xd) << '\n';
std::cout << "-> laguerre[associated](3, m, xd) = " << eve::laguerre[eve::associated](3, m, xd) << '\n';
std::cout << "-> laguerre[associated](n, 3, xd) = " << eve::laguerre[eve::associated](n, 3, xd) << '\n';
std::cout << "-> laguerre[associated](n, m, x) = " << eve::laguerre[eve::associated](n, m, x) << '\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