6#include <memory_resource>
7#include <nk/value/value.hpp>
8#include <nk/value/span.hpp>
10namespace nk::builtin {
Core MATLAB-compatible multidimensional array and scalar value type.
Value perms(const Value &v, std::pmr::memory_resource *mr=nullptr)
All permutations of a vector elements.
Value gammaincinv(const Value &y, const Value &a, std::pmr::memory_resource *mr=nullptr)
Inverse incomplete gamma function.
Value factorial(const Value &n, std::pmr::memory_resource *mr=nullptr)
Factorial of non-negative integer elements (n!).
Value 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 besseli(const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr)
Modified Bessel function of the first kind (I_ν(z)).
Value 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 colperm(const Value &s, std::pmr::memory_resource *mr=nullptr)
Column permutation vector for sparse matrix bandwidth/fill-in reduction (colperm(s)).
Value betaln(const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr)
Natural logarithm of the beta function (ln B(z, w)).
Value erf(const Value &x, std::pmr::memory_resource *mr=nullptr)
Error function (erf(x) = 2/√π ∫_0^x e^(-t^2) dt).
EllipKE ellipke(const Value &m, std::pmr::memory_resource *mr=nullptr)
Complete elliptic integrals of the first and second kind ([K, E] = ellipke(m)).
Value 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 expint(const Value &x, std::pmr::memory_resource *mr=nullptr)
Exponential integral function (E_1(x)).
Value erfcx(const Value &x, std::pmr::memory_resource *mr=nullptr)
Scaled complementary error function (erfcx(x) = exp(x^2) * erfc(x)).
Value betainc(const Value &x, const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr)
Incomplete beta function (I_x(z, w)).
Value besselk(const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr)
Modified Bessel function of the second kind (K_ν(z)).
Value erfc(const Value &x, std::pmr::memory_resource *mr=nullptr)
Complementary error function (erfc(x) = 1 - erf(x)).
Value factor(double n, std::pmr::memory_resource *mr=nullptr)
Computes prime factors of positive integer (factor(n)).
Value besselj(const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr)
Bessel function of the first kind (J_ν(z)).
Value erfinv(const Value &x, std::pmr::memory_resource *mr=nullptr)
Inverse error function (erfinv(y)).
Value erfcinv(const Value &x, std::pmr::memory_resource *mr=nullptr)
Inverse complementary error function (erfcinv(y)).
Value nchoosek(double n, double k, std::pmr::memory_resource *mr=nullptr)
Computes binomial coefficient n choose k (nchoosek(n, k)).
Value psi(const Value &x, std::pmr::memory_resource *mr=nullptr)
Digamma / polygamma function (ψ(x) = d/dx ln Γ(x)).
Value 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 bessely(const Value &nu, const Value &z, std::pmr::memory_resource *mr=nullptr)
Bessel function of the second kind (Neumann function Y_ν(z)).
Value betaincinv(const Value &y, const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr)
Inverse incomplete beta function.
Value legendre(int n, const Value &x, std::pmr::memory_resource *mr=nullptr)
Associated Legendre functions (P_n^m(x)).
EllipJ ellipj(const Value &u, const Value &m, std::pmr::memory_resource *mr=nullptr)
Jacobi elliptic functions ([sn, cn, dn] = ellipj(u, m)).
Value airy(int k, const Value &z, std::pmr::memory_resource *mr=nullptr)
Airy function (Ai(z) or k-th derivative / Bi).
Value symrcm(const Value &s, std::pmr::memory_resource *mr=nullptr)
Symmetric reverse Cuthill-McKee ordering permutation vector (symrcm(s)).
Value isprime(const Value &x, std::pmr::memory_resource *mr=nullptr)
Tests if array elements are prime numbers (isprime(x)).
Value gammaln(const Value &x, std::pmr::memory_resource *mr=nullptr)
Logarithm of the absolute value of the gamma function (ln|Γ(x)|).
Value beta(const Value &z, const Value &w, std::pmr::memory_resource *mr=nullptr)
Beta function (B(z, w) = Γ(z)Γ(w) / Γ(z+w)).
Value gamma(const Value &x, std::pmr::memory_resource *mr=nullptr)
Complete gamma function (Γ(x)).
Value 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 gammainc(const Value &x, const Value &a, std::pmr::memory_resource *mr=nullptr)
Incomplete gamma function (P(a, x)).
Jacobi elliptic functions ([sn, cn, dn] = ellipj(u, M)).
Value sn
Jacobi elliptic sine function sn(u|M).
Value dn
Jacobi delta amplitude function dn(u|M).
Value cn
Jacobi elliptic cosine function cn(u|M).
Complete elliptic integrals of the first and second kinds ([K, E] = ellipke(M)).
Value E
Complete elliptic integral of the second kind.
Value K
Complete elliptic integral of the first kind.