nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
Index

Fundamentals

🔢
elmat — Elementary Matrices & Arrays
Constructors (zeros, ones, eye, rand), shape transformations (reshape, permute, repmat, cat), and test matrices.
📐
elfun — Elementary Math Functions
Trigonometric (sin, cos, atan2), exponential (exp, log, sqrt), complex (abs, angle), and rounding (floor, ceil, mod).
⚡
ops — Operators & Elementary Operations
Arithmetic (+, -, .*, ./), relational (==, <), logical (&, |, ~), bitwise (bitand, bitshift), and transpose (.').
🧮
matfun / linalg — Matrix Algebra & Solvers
Linear equation solvers (linsolve, mldivide, inv), decompositions (lu, qr, chol, svd, eig), and matrix functions.
📈
datafun — Data Analysis & Fourier Transforms
Summary reductions (sum, mean, std), cumulative diffs (cumsum, diff), 1D/2D FFTs (fft, ifft), and accumarray.
🔬
specfun — Specialized Math Functions
Bessel functions (besselj, bessely), Airy functions, Gamma, Beta, Error functions (erf, erfc), and number theory.
📊
polyfun — Polynomials & Interpolation
Polynomial operations (polyfit, polyval, roots), 1D/2D/3D interpolation (interp1, griddata), and splines (spline, pchip).
📝
strfun — Strings & Text Manipulation
String composition (sprintf, compose, strjoin), search & regex (strcmp, strfind, regexp), and numerical conversions.
📦
datatypes — Data Types, Structs & Cells
Structure arrays (struct, fieldnames), Cell arrays (cell, cellfun, deal), type casting, and predicates (isa, isnumeric).
⏱️
timefun — Time & Date Functions
Wall-clock timers (tic, toc), date arithmetic (now, datestr, datevec), and execution delays.
🛠️
lang — Language Syntax, Diagnostics & Help
Keywords, variable validation (isvarname), error diagnostics (error, warning, lastwarn), and help (help, what).
💾
iofun — File I/O & Persistence
Workspace persistence (save, load, who, clear), text parsing (textscan, csvread), and formatted streams.

Toolboxes

📡
Signal Processing Toolbox (signal)
IIR/FIR filter design (butter, fir1), filter implementation (filtfilt, sosfilt), spectral analysis (pwelch, spectrogram), and windows.
📊
Statistics and Machine Learning (stats)
20+ Probability distributions (normpdf, tinv), hypothesis tests (ttest, anova1), regression (regress, fitlm, lasso), and pca.
🖼️
Image Processing Toolbox (image)
Color space transforms (rgb2gray, rgb2hsv), morphology (imerode, imreconstruct, bwlabel), spatial filtering, and quality metrics (psnr, ssim).
⚙️
Control System Toolbox (control)
LTI model conversions (tf2ss, ss2tf, zp2tf), frequency response (bode, nyquist), time response (step, impulse), and stability metrics.
🎯
Optimization Toolbox (optim)
Unconstrained & bound optimization (fminunc, fminbnd), nonlinear equations (fzero, fsolve), and curve fitting (lsqcurvefit, lsqnonlin).
🌊
Wavelet Toolbox (wavelet)
1D/2D Discrete Wavelet Transforms (dwt, wavedec2), Stationary Wavelets (swt), filter banks (wfilters), and wavelet denoising (wdenoise).
📶
Communications Toolbox (comm)
Digital modulation (pskmod, qammod, fskmod, ofdmmod), channel models (awgn, rayleighchan), error control coding, and scrambling.
🎵
Audio Toolbox (audio)
Pitch estimation (pitch, harmonicRatio), spectral shape descriptors (spectralCentroid, spectralFlux), and representations (mfcc, melSpectrogram).
🔄
Differential Equations (ode)
Explicit & implicit Runge-Kutta numerical ODE integrators (ode45, ode23, ode113, ode15s, ode23s) and integration options (odeset).
📊
2D & 3D Scientific Graphics (graphics)
Interactive figures, line plots (plot), surface meshes (surf, mesh), scatter charts, histograms, colormaps, and plot styling.

Quick Code Example

#include <nk/builtin/builtin.hpp>
#include <nk/signal/signal.hpp>
#include <nk/linalg/linalg.hpp>
#include <iostream>
using namespace nk;
int main() {
// 1. Pure C++ Public API with SIMD acceleration
Value t = builtin::linspace(0.0, 1.0, 1000);
Value sig = builtin::sin(2.0 * 3.141592653589793 * 50.0 * t);
// 2. DSP Signal Processing
Value filtered = signal::filter(signal::fir1(16, 0.2), Value::scalar(1.0), sig);
// 3. Embedded Scripting Engine
auto engine = makeStandardEngine();
engine->eval("x = [1, 2, 3; 4, 5, 6];");
Value res = engine->eval("y = sum(x, 1) * 2;");
std::cout << "Result: " << res.toString() << std::endl;
return 0;
}
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value sin(const Value &x, std::pmr::memory_resource *mr=nullptr)
Elementwise sine in radians (y = sin(x)).
Value linspace(double a, double b, size_t n=100, std::pmr::memory_resource *mr=nullptr)
Generates linearly spaced vector between a and b.
Value fir1(int N, double Wn, const std::string &type="low", std::pmr::memory_resource *mr=nullptr)
FIR filter design via windowed-sinc (Hamming window).
Value filter(const Value &b, const Value &a, const Value &x, std::pmr::memory_resource *mr=nullptr)
Direct-form II transposed IIR / FIR filter.