Special mathematical functions (gamma, beta, erf, Bessel, Airy, combinatorics). More...
#include <memory_resource>#include <nk/value/value.hpp>#include <nk/value/span.hpp>Go to the source code of this file.
Classes | |
| struct | nk::builtin::EllipKE |
| Complete elliptic integrals of the first and second kinds ([K, E] = ellipke(M)). More... | |
| struct | nk::builtin::EllipJ |
| Jacobi elliptic functions ([sn, cn, dn] = ellipj(u, M)). More... | |
Functions | |
| Value | nk::builtin::gamma (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Complete gamma function (Γ(x)). | |
| Value | nk::builtin::gammaln (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Logarithm of the absolute value of the gamma function (ln|Γ(x)|). | |
| Value | nk::builtin::gammainc (const Value &x, const Value &a, std::pmr::memory_resource *mr=nullptr) |
| Incomplete gamma function (P(a, x)). | |
| Value | nk::builtin::gammaincinv (const Value &y, const Value &a, std::pmr::memory_resource *mr=nullptr) |
| Inverse incomplete gamma function. | |
| Value | nk::builtin::psi (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Digamma / polygamma function (ψ(x) = d/dx ln Γ(x)). | |
| Value | nk::builtin::beta (const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr) |
| Beta function (B(z, w) = Γ(z)Γ(w) / Γ(z+w)). | |
| Value | nk::builtin::betaln (const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr) |
| Natural logarithm of the beta function (ln B(z, w)). | |
| Value | nk::builtin::betainc (const Value &x, const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr) |
| Incomplete beta function (I_x(z, w)). | |
| Value | nk::builtin::betaincinv (const Value &y, const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr) |
| Inverse incomplete beta function. | |
| Value | nk::builtin::erf (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Error function (erf(x) = 2/√π ∫_0^x e^(-t^2) dt). | |
| Value | nk::builtin::erfc (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Complementary error function (erfc(x) = 1 - erf(x)). | |
| Value | nk::builtin::erfcx (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Scaled complementary error function (erfcx(x) = exp(x^2) * erfc(x)). | |
| Value | nk::builtin::erfinv (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Inverse error function (erfinv(y)). | |
| Value | nk::builtin::erfcinv (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Inverse complementary error function (erfcinv(y)). | |
| Value | nk::builtin::besselj (const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Bessel function of the first kind (J_ν(z)). | |
| Value | nk::builtin::bessely (const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Bessel function of the second kind (Neumann function Y_ν(z)). | |
| Value | nk::builtin::besseli (const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Modified Bessel function of the first kind (I_ν(z)). | |
| Value | nk::builtin::besselk (const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Modified Bessel function of the second kind (K_ν(z)). | |
| Value | nk::builtin::besselh (const Value &nu, int k, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Bessel function of the third kind (Hankel function H_ν^(k)(z)). | |
| Value | nk::builtin::airy (int k, const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Airy function (Ai(z) or k-th derivative / Bi). | |
| Value | nk::builtin::airy (const Value &z, std::pmr::memory_resource *mr=nullptr) |
| Airy function of the first kind (Ai(z)). | |
| Value | nk::builtin::expint (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Exponential integral function (E_1(x)). | |
| EllipKE | nk::builtin::ellipke (const Value &m, std::pmr::memory_resource *mr=nullptr) |
| Complete elliptic integrals of the first and second kind ([K, E] = ellipke(m)). | |
| EllipJ | nk::builtin::ellipj (const Value &u, const Value &m, std::pmr::memory_resource *mr=nullptr) |
| Jacobi elliptic functions ([sn, cn, dn] = ellipj(u, m)). | |
| Value | nk::builtin::legendre (int n, const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Associated Legendre functions (P_n^m(x)). | |
| Value | nk::builtin::factorial (const Value &n, std::pmr::memory_resource *mr=nullptr) |
| Factorial of non-negative integer elements (n!). | |
| Value | nk::builtin::primes (double n, std::pmr::memory_resource *mr=nullptr) |
| Generates row vector of all prime numbers less than or equal to n (primes(n)). | |
| Value | nk::builtin::primes (const Value &n, std::pmr::memory_resource *mr=nullptr) |
| Generates row vector of all prime numbers less than or equal to n (primes(n)). | |
| Value | nk::builtin::isprime (const Value &x, std::pmr::memory_resource *mr=nullptr) |
| Tests if array elements are prime numbers (isprime(x)). | |
| Value | nk::builtin::factor (double n, std::pmr::memory_resource *mr=nullptr) |
| Computes prime factors of positive integer (factor(n)). | |
| Value | nk::builtin::factor (const Value &n, std::pmr::memory_resource *mr=nullptr) |
| Computes prime factors of positive integer value (factor(n)). | |
| Value | nk::builtin::nchoosek (double n, double k, std::pmr::memory_resource *mr=nullptr) |
| Computes binomial coefficient n choose k (nchoosek(n, k)). | |
| Value | nk::builtin::nchoosekCombinations (const Value &v, double kd, std::pmr::memory_resource *mr=nullptr) |
| Generates all combinations of vector elements taken k at a time (nchoosek(v, k)). | |
| Value | nk::builtin::nchoosek (const Value &v, int k, std::pmr::memory_resource *mr=nullptr) |
| Binomial coefficient or all combinations (nchoosek(v, k)). | |
| Value | nk::builtin::nchoosek (const Value &v, const Value &k, std::pmr::memory_resource *mr=nullptr) |
| Binomial coefficient or all combinations (nchoosek(v, k)). | |
| Value | nk::builtin::perms (const Value &v, std::pmr::memory_resource *mr=nullptr) |
| All permutations of a vector elements. | |
| Value | nk::builtin::gcd (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr) |
| Greatest common divisor of two integers or arrays (gcd(a, b)). | |
| Value | nk::builtin::lcm (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr) |
| Least common multiple of two integers or arrays (lcm(a, b)). | |
| Value | nk::builtin::colperm (const Value &s, std::pmr::memory_resource *mr=nullptr) |
| Column permutation vector for sparse matrix bandwidth/fill-in reduction (colperm(s)). | |
| Value | nk::builtin::symrcm (const Value &s, std::pmr::memory_resource *mr=nullptr) |
| Symmetric reverse Cuthill-McKee ordering permutation vector (symrcm(s)). | |
Special mathematical functions (gamma, beta, erf, Bessel, Airy, combinatorics).
Provides a clean, engine-free C++ API for special functions across analysis, number theory, combinatorics, and mathematical physics.
Definition in file specfun.hpp.