Catalogue of algorithms
This catalogue lists everything the library implements, grouped by subject. Use it to find where an algorithm lives, to see the neighbours of the one you are studying, or to plan a path through the book. It describes the current release and is updated whenever an algorithm is added; the changelog records what changed between releases, and planned work is tracked in GitHub issues.
Book chapters follow the same subjects. Where a chapter has been written, its crate heading links to it; the integration chapter is the first. For the precise types, functions and parameters, follow the API reference link under each crate.
The library implements 655 algorithms and components in 23 crates:
| Subject | Crates | Items |
|---|---|---|
| Calculus and analysis | Derivatives, Integration, Interpolation, Root finding, Optimisation, Special functions | 175 |
| Linear algebra and transforms | Linear algebra, Linear algebra reference, FFTs, FFT reference | 69 |
| Probability, statistics and learning | Random, Statistics, Machine learning | 103 |
| Signals, information and fields | DSP, Information, Electromagnetics | 204 |
| Discrete mathematics and geometry | Number theory, Graph, Geometry | 81 |
| Foundations and input/output | Core, Utils, Sorting and selection, File IO | 23 |
Calculus and analysis
Derivatives, integrals, interpolation, equations and optimisation of functions, and the special functions of mathematical physics.
Derivatives
Numerical differentiation routines for scalar and vector-valued functions.
Crate lib_jsl_derivatives: API reference · book chapter · 3 items
- Scalar derivatives (1D)
- Vector derivatives
- Adaptive derivatives with error estimates (Ridders), Jacobians and Hessians
Integration
Numerical integration: quadrature, cubature, quasi-Monte Carlo, ODE solvers, boundary value problems and PDEs.
Crate lib_jsl_integration: API reference · book chapter · 30 items
- Integrator trait (1D)
- Adaptive Gauss-Kronrod (G7-K15)
- Adaptive trapezoid
- Dormand-Prince
- Midpoint
- Sample-point helpers (grid points, panel midpoints)
- Monte Carlo
- Runge-Kutta
- Simpson’s 1/3 rule
- Trapezoidal
- Complex path integrals
- Gauss-Legendre, Gauss-Hermite and Gauss-Laguerre quadrature
- Tanh-sinh quadrature
- Vector-valued adaptive quadrature (quad_vec)
- Weighted quadrature: oscillatory, Fourier, algebraic-logarithmic, Cauchy principal value
- Filon-Clenshaw-Curtis quadrature for oscillatory integrals
- Romberg integration
- Sampled-data rules: trapezoid, Simpson, Romberg, cumulative integrals
- Multidimensional cubature
- Quasi-Monte Carlo integration
- Stiff ODE solvers (BDF, Rosenbrock)
- Radau IIA (order 5)
- LSODA: Adams/BDF with automatic stiffness switching
- Dense output and event location
- Explicit RK45 and DOP853 with backward integration and per-component tolerances
- Sparse Jacobians for stiff systems (grouped finite differences, sparse LU)
- Boundary value problems (shooting, collocation)
Partial differential equations
Interpolation
Interpolation in one to N dimensions: splines, rational, Chebyshev, Fourier and radial basis functions.
Crate lib_jsl_interpolation: API reference · book chapter · 53 items
1D
- Linear
- Natural cubic spline
- Polynomial
- PCHIP
- Akima
- Cubic basis (Catmull-Rom)
- AAA
- Prony’s method
- Padé approximants
- Floater-Hormann
- Bulirsch-Stoer rational interpolation
- Fourier 1D
- Chebyshev approximations
- Lagrange interpolant
- Savitzky-Golay
- B-splines of any degree: evaluation, derivatives, antiderivatives, integrals
- Interpolating splines with not-a-knot, natural, clamped, periodic or given-derivative ends
- Least-squares splines on given knots; parametric spline curves
- Cubic smoothing spline with generalised cross-validation
- Piecewise polynomials (
PPoly): derivatives, antiderivatives, integrals and roots - Cubic Hermite spline from values and slopes
- Krogh interpolation through values and derivatives
- Modified Akima (makima)
2D
- Nearest
- Bilinear
- Bicubic
- Lanczos
- Cubic basis
- All-phase
- Radial basis functions
- Fourier 2D
- Tensor-product interpolating splines (
RectBivariateSpline) - Piecewise linear on a Delaunay triangulation
- Piecewise linear interpolation of scattered data in any dimension (
LinearNdInterpolator) - Clough-Tocher C¹ interpolation with global gradient estimation
- Nearest neighbour for scattered points;
griddata
3D
ND
- Grid data
- Nearest
- Cubic basis
- Radial basis functions in any dimension, with polynomial tails and smoothing
- Smoothing splines with automatic knots (FITPACK’s
curfit:make_splrep,generate_knots) - Periodic smoothing splines (FITPACK’s
percur) - Smoothing spline surfaces for scattered data (
bisplrep) - Least-squares spline surfaces on given knots (
LSQBivariateSpline) - Smoothing parametric spline curves (FITPACK’s
parcur:make_splprep) - Bernstein-basis piecewise polynomials (
BPoly,from_derivatives)
Root finding
Root finding: bracketing methods, Brent, Newton, polynomial roots and nonlinear systems.
Crate lib_jsl_root_finding: API reference · book chapter · 13 items
- Bracketing
- Bisection
- Secant method
- False position method
- Ridders’ method
- Van Wijngaarden-Dekker-Brent
- Newton-Raphson
- Polynomial roots
- Nonlinear systems (Newton, Broyden)
- Jacobian-free Newton-Krylov (
newton_krylov) - Halley’s method
- Fixed points by Steffensen’s method (
fixed_point) - MINPACK’s Levenberg-Marquardt (
leastsq,root_lm)
Optimisation
Optimisation algorithms including gradient-based, gradient-free, and stochastic methods.
Crate lib_jsl_optimization: API reference · book chapter · 37 items
- Optimisation traits
- Golden section search
- Gradient descent
- Nelder-Mead
- Newton-Raphson
- Simulated annealing
- Powell’s method
- Linear programming
- Dynamic programming
- Nonlinear least squares and curve fitting (Levenberg-Marquardt)
- Quasi-Newton methods (BFGS, L-BFGS)
- Nonlinear conjugate gradient
- Constrained optimisation (SQP, augmented Lagrangian)
- COBYLA (derivative-free, linear approximations)
- SLSQP (sequential least-squares quadratic programming)
- COBYQA (derivative-free, quadratic models, bounds and nonlinear constraints)
- trust-constr (Byrd-Omojokun SQP with an interior-point barrier)
- trust-krylov (GLTR Lanczos trust-region subproblems)
- Least squares with an LSMR trust-region solver (sparse or matrix-free Jacobians)
- Simplicial homology global optimisation (
shgo, Sobol sampling) - Quadratic assignment (Fast Approximate QAP with seeds and randomised starts, 2-opt)
- L-BFGS-B
- Bounded nonlinear least squares (trust-region reflective) with robust losses
- Bounded linear least squares (BVLS) and non-negative least squares (NNLS)
- Differential evolution
- Particle swarm optimisation
- Linear sum assignment (shortest augmenting paths)
- Trust-region Newton-CG (Steihaug)
- Dogleg trust-region method
- Nearly exact trust-region method (Moré-Sorensen)
- Basin hopping
- Dual annealing (generalised simulated annealing with local search)
- DIRECT-L global optimisation
- Brute-force grid search (
brute) - Isotonic regression (pool adjacent violators)
- Finite-difference gradients and gradient checks (
approx_fprime,check_grad) - Bounded least squares by the dogbox method
- Mixed-integer linear programming by branch and bound (
milp) - Truncated Newton with bounds (TNC)
Special functions
Special functions: gamma, beta, error, Bessel, Airy, elliptic, hypergeometric and zeta functions, orthogonal polynomials.
Crate lib_jsl_special_functions: API reference · book chapter · 39 items
- Gamma
- Beta
- Factorial
- Binomial coefficients
- Incomplete gamma
- Error function
- Exponential integrals
- Incomplete beta
- Bessel functions (integer order)
- Bessel functions (fractional order)
- Bessel functions (spherical)
- Airy functions
- Fresnel integrals
- Cosine integrals
- Sine integrals
- Dawson’s integral
- Fermi-Dirac integrals
- Inverse of x log x
- Elliptic integrals
- Jacobian elliptic functions
- Hypergeometric functions
- Statistical functions
- Orthogonal polynomials (Legendre, Hermite, Laguerre, Chebyshev, Jacobi)
- Associated Legendre functions and spherical harmonics
- Riemann zeta
- Lambert W
- Polylogarithm
- Log-domain functions: logsumexp, softmax, logit and expit, log of the normal CDF, Box-Cox
- Polygamma functions and the multivariate log-gamma function
- Bernoulli and Euler numbers
- Inverse incomplete gamma and beta functions (Halley’s method)
- Faddeeva function and Voigt profile
- Struve functions
- Kelvin functions
- Mathieu functions and characteristic values (periodic and modified, both kinds)
- Parabolic cylinder functions D_v, V_v and W(a, x)
- Spheroidal wave functions: characteristic values, angular functions, radial functions of the first kind
- Spheroidal radial functions of the second kind (
pro_rad2,obl_rad2) - Hankel functions
- Zeros of Bessel functions
Linear algebra and transforms
Dense and sparse matrix factorisations, solvers and eigenproblems, Fourier transforms, and readable reference implementations of both.
Linear algebra
Linear algebra in pure Rust: LU, Cholesky, eigensolvers, the SVD and least squares for real and complex matrices, and sparse matrices with direct and Krylov solvers.
Crate lib_jsl_linalg: API reference · book chapter · 41 items
- LU factorisation: solves, inverse, determinant
- Cholesky factorisation and triangular solves
- Hermitian eigenproblem (Householder tridiagonalisation, implicit QL)
- General eigenproblem (Hessenberg reduction, shifted QR, complex Schur form)
- Singular value decomposition (Golub-Kahan; one-sided Jacobi)
- Matrix exponential (scaling and squaring with Padé approximants)
- Sylvester and Lyapunov equations (Bartels-Stewart)
- Continuous and discrete algebraic Riccati equations (matrix sign function, doubling, Newton)
- Matrix square root, logarithm and fractional powers (Schur method, inverse scaling and squaring)
- Pseudoinverse, numerical rank, null space and range bases
- Matrix norms and condition numbers
- QR with column pivoting and RQ (LAPACK conventions)
- Hessenberg and real Schur forms with standardised 2 × 2 blocks
- Bunch-Kaufman LDLᵀ factorisation
- Polar decomposition
- Principal angles between subspaces
- General matrix functions (Schur-Parlett)
- Symmetric-definite generalised eigenproblems (Cholesky reduction)
- The QZ algorithm and general generalised eigenproblems
- Structured matrices: Toeplitz, Hankel, circulant, Hadamard, block diagonal, companion, Pascal, Hilbert, Leslie, DFT, convolution, Fiedler
- Toeplitz systems by Levinson recursion
- Circulant systems by the FFT
- Banded LU and banded Cholesky solvers
- Real QZ algorithm (real generalised Schur form)
- Reordered Schur forms (
schur(sort=...)) - Reordered generalised Schur forms (
ordqz) - Least squares (pivoted QR, SVD for rank-deficient systems)
- Sparse storage: COO, CSR and CSC matrices, products and conversions
- Reverse Cuthill-McKee bandwidth-reducing ordering
- Sparse LU with partial pivoting (Gilbert-Peierls) and
spsolve - Krylov solvers: CG, MINRES, GMRES, BiCGSTAB and LSQR with preconditioning
- LSMR for damped sparse least squares
- Approximate minimum-degree ordering on a quotient graph (
minimum_degree), and the exact one (minimum_degree_exact) - COLAMD column ordering for unsymmetric and rectangular matrices, and SYMAMD for symmetric ones
- Nested dissection ordering by multilevel graph bisection
- Incomplete LU preconditioners: ILU(0) and ILUT
- Incomplete Cholesky preconditioners: IC(0) and ICT, with Manteuffel shifts
- The action of the matrix exponential (
expm_multiply) - Interior eigenvalues by shift-invert Lanczos
- A few eigenvalues and singular values of large matrices (Lanczos with deflation:
eigsh,svds) - A few eigenvalues of large nonsymmetric matrices (Krylov-Schur Arnoldi:
eigs, with shift-invert) - LGMRES: restarted GMRES augmented with earlier error approximations
- Complex sparse matrices: storage, products, sparse LU, CG, GMRES and BiCGSTAB
- Benchmarks against LAPACK (
ndarray-linalg)
Linear algebra reference
Readable textbook linear algebra algorithms for study, plus a benchmark comparing them with lib_jsl_linalg.
Crate lib_jsl_linalg_reference: API reference · book chapter · 10 items
- Gaussian elimination without and with partial pivoting
- Doolittle LU: solves, determinant, inverse
- Cholesky-Banachiewicz
- Classical and modified Gram-Schmidt, Householder QR
- Power, inverse and Rayleigh quotient iteration
- Cyclic Jacobi eigenvalue method
- Unshifted and Wilkinson-shifted QR algorithm with deflation
- SVD from the eigenproblem of AᵀA
- Least squares by normal equations and by QR
- Linear algebra race benchmark
FFTs
Fast Fourier transform engines and related spectral transforms.
Crate lib_jsl_ffts: API reference · book chapter · 18 items
- FFT (default engine: picks the algorithm by size)
- Best FFT
- Bluestein FFT
- Fractional FFT
- SIMD FFT (generic, x86, ARM, RISC-V)
- FFT engine trait
- Real-input FFT
- Multidimensional FFT (2D, 3D)
- Discrete cosine and sine transforms
- Frequency grids and shifts (
fftfreq,rfftfreq,ifftshift) - Fast transform lengths (
next_fast_len) - N-dimensional real FFTs and DCTs/DSTs (
rfftn,dctn,dstn) - FFTs of Hermitian signals (
hfft,ihfft) - Fast Hankel transform (FFTLog:
fht,ifht,fhtoffset) - Size-sweep benchmark
FFT reference
Readable reference FFT implementations for study, plus a benchmark comparing them with the production engines.
Crate lib_jsl_ffts_reference: API reference · book chapter · 4 items
Probability, statistics and learning
Random numbers, statistical inference and machine learning.
Random
Random number generators, quasi-random sequences, distributions and MCMC.
Crate lib_jsl_random: API reference · book chapter · 29 items
- Histogram
- Uniform RNG
- xoshiro256++
- SplitMix64
- Quasi-random sequences (Sobol, Halton)
- Scrambled Sobol and Halton sequences (linear matrix scrambling, digit permutations)
- Latin hypercube sampling
- Poisson-disk sampling (Bridson’s algorithm)
- Discrepancy (centered, wrap-around, mixture, L²-star) and scaling to a box
- Markov chain Monte Carlo (Metropolis-Hastings)
Distributions
- Exponential
- Uniform (float)
- Bernoulli
- Geometric
- Weibull
- Poisson
- Gaussian
- Chi-squared
- Student’s t
- Gamma
- Beta
- Discrete distributions by the alias method and by guide-table inversion
- Transformed density rejection (adaptive rejection sampling) for log-concave densities
- Ratio of uniforms
- Numerical inversion of a distribution function by Hermite interpolation, with quasi-Monte Carlo variates
- Simple ratio of uniforms for unimodal densities
- Numerical inversion from the density alone by polynomial interpolation (
NumericalInversePolynomial,FastGeneratorInversion) - Multivariate ratio of uniforms for unimodal densities in any dimension
- Log-normal
- Cauchy
- Binomial
- Multivariate normal
- Dirichlet
Statistics
Descriptive and circular statistics, correlation, robust regression, distances, hypothesis tests, density estimation and resampling.
Crate lib_jsl_statistics: API reference · book chapter · 37 items
- Descriptive statistics
- Distribution objects: pdf, cdf, sf, quantiles and moments for 20 continuous and 5 discrete distributions
- Maximum-likelihood fitting of distributions
- Owen’s T function and the skew-normal distribution; the von Mises distribution function
- Correlation and covariance (Pearson, Spearman, Kendall)
- Hypothesis tests (t tests, chi-square, ANOVA, Kolmogorov-Smirnov, Mann-Whitney)
- Kernel density estimation
- Normality tests (Shapiro-Wilk, Anderson-Darling, D’Agostino-Pearson, Jarque-Bera)
- Equal variances (Levene, Bartlett, Fligner-Killeen)
- Rank tests (Kruskal-Wallis, Friedman, Wilcoxon signed-rank)
- Exact tests (Fisher’s exact test, binomial test)
- Permutation tests
- Multiple comparisons (Bonferroni, Holm, Benjamini-Hochberg, Benjamini-Yekutieli)
- Bootstrap (percentile, BCa)
- Straight-line fits (least squares with standard errors, Theil-Sen and Siegel)
- Trimmed means, z-scores and the mode
- Circular statistics
- Maximum-likelihood Box-Cox transform
- Distances between observations (13 metrics;
pdist,cdist,squareform) - Rice distribution
- Multivariate normal distribution
- Multivariate Student t distribution
- Dirichlet distribution
- Wishart and inverse Wishart distributions
- Multinomial distribution
- Cramér-von Mises tests (one and two samples)
- Brunner-Munzel test
- Studentized range distribution
- Tukey’s HSD with simultaneous intervals (Tukey-Kramer, Games-Howell)
- Odds ratio, conditional and sample, with exact and Woolf intervals
- Relative risk with Katz’s interval
- Cramér’s V, Tschuprow’s T, Pearson’s contingency coefficient
- Monte Carlo hypothesis tests
- Multivariate normal and t distribution functions (Genz’s lattice method; exact bivariate normal)
- Multivariate normal with singular covariance
- Dunnett’s many-to-one comparisons, with simultaneous confidence intervals
- Quasi-Monte Carlo normal samples (
MultivariateNormalQMC)
Machine learning
Machine learning: regression, classification, clustering, dimensionality reduction, neural networks and boosting.
Crate lib_jsl_machine_learning: API reference · book chapters: regression and classification, clustering and dimensionality reduction, neural networks, ensembles, model selection and sequence models · 40 items
Foundations
- Model traits (regressor, classifier, clusterer, transformer)
- Metrics
- Synthetic datasets
- Preprocessing (scaling, train/test split)
- Kernels
Supervised
Regression
- Least squares
- General least squares
- Ridge
- Elastic net (coordinate descent)
- Support vector regression
Classification
- k-nearest neighbours
- Phylogenetic trees (UPGMA, neighbour joining)
- Viterbi algorithm
- Decision trees and random forests
- Support vector machine (SMO)
- Logistic regression
- Naive Bayes (Gaussian, multinomial)
Unsupervised
Clustering
- k-means (k-means++)
- k-medoids
- Hierarchical clustering
- Inconsistency coefficients and SciPy linkage matrices
- Optimal leaf ordering (Bar-Joseph-Gifford-Jaakkola)
- Whitening (
whiten) - DBSCAN
- HDBSCAN
- Gaussian mixture models
- Spectral clustering
Reduction
Neural networks
Ensembles and model selection
Sequence models
Demonstrations
Signals, information and fields
Signal processing, information theory and coding, and electromagnetics.
DSP
Digital signal processing routines including filters, transforms, resampling, and controls.
Crate lib_jsl_dsp: API reference · book chapters: filter design, FIR and IIR filters, adaptive filters, spectral estimation, windows, resampling and multirate processing, synchronisation, communications, radar and controls, image processing · 146 items
Continuous
Filters
- Bilinear transform
- Bilinear transform (zero-pole-gain form)
- Filter design types and band transforms (Zpk, Tf, lp2lp, lp2hp, lp2bp, lp2bs)
- Bessel
- Butterworth
- Chebyshev type I and II
- Elliptic
Spectral
Discrete
Windows
- Boxcar
- Triangular
- Parzen
- Bohman
- Blackman
- Nuttall
- Blackman-Harris
- Flat top
- Bartlett
- Bartlett-Hann
- Hamming
- Hann
- Kaiser (including beta and tap-count estimation helpers)
- Kaiser-Bessel derived
- Gaussian
- General Gaussian
- Dolph-Chebyshev
- Cosine
- Exponential
- Tukey
- Taylor
- DPSS (Slepian)
- Lanczos
- General cosine
- General Hamming
Controls
- Kalman filter
- PID loop
- State-space model
- Continuous-time state space: transfer-function conversions, exact simulation (lsim, step, impulse)
- Frequency response and Bode diagrams
- Discretisation: zero- and first-order hold, impulse invariance, bilinear and Euler
- Pole placement by state feedback (Kautsky-Nichols-Van Dooren)
- Zeros-poles-gain systems in continuous and discrete time (
ZerosPolesGain)
Sources
Digital communications
- Constellations
- Barker codes
- Decision feedback equaliser
- Farrow filter
- Mueller timing detector
- OFDM
- FM
- Pulse correlation tracker
- Addressable shift register
- Ping-pong buffer
Image
Filters
- Sobel
- Gaussian blur
- Histogram equalisation
- Sharpening
- Wiener filtering
- Rank filters: median, percentile, minimum, maximum
- Gaussian derivative filters, Laplacian of Gaussian, laplace
- Fourier-domain Gaussian, box and ellipse filters
Morphology
- Binary erosion, dilation, opening, closing and hole filling
- Greyscale morphology, top-hats and morphological gradient
- Distance transforms (exact Euclidean, chamfer)
- Connected-component labelling and region measurements
Geometric transforms
- B-spline interpolation (orders 0–5) and map_coordinates
- Affine transform, shift, zoom and rotate
- Sub-pixel shift by a Fourier phase ramp
Segmentation
Feature extraction
- SIFT (scale-invariant feature transform)
- SURF (speeded-up robust features)
- Hough transform
- Blob detection
Filters
FIR
- Boxcar integrator
- Derivative filters
- firwin
- firwin2
- Overlap-add FIR
- Remez exchange algorithm
- FFT FIR
IIR
- Bessel
- Biquad
- Butterworth
- Chebyshev type I
- Chebyshev type II
- Discrete linear filter (direct forms)
- Elliptic
- Comb
- Notch
- Peak
- Second-order sections (zpk2sos, tf2sos, sosfilt)
- Steady-state initial conditions (lfilter_zi, sosfilt_zi)
- Zero-phase filtering (filtfilt, sosfiltfilt)
Resampling
Spectral
- Chirp-z transform
- freqz
- Critically sampled polyphase filter bank
- Oversampled polyphase filter bank
- Non-uniformly sampled spectra
- MUSIC
- Maximum entropy
- Linear predictive coding
- Wavelet transform
- Welch power spectral density
- Short-time Fourier transform and spectrogram
- Hilbert transform and analytic signal
- Goertzel algorithm
- Peak finding (prominence, width)
- Group delay and minimum-phase conversion (homomorphic)
- Least-squares FIR design (firls)
- Decimation and FFT resampling
- Median filter and amplitude envelope
- Partial fractions (residue, residuez) and their inverses
- Deconvolution by polynomial division
- Zero-pole-gain conversions (tf2zpk, zpk2tf, ss2zpk, zpk2ss)
- Zoom FFT
- Test waveforms: chirps, polynomial sweeps, Gaussian pulses, sawtooth and square waves
- Padé approximation of time delays; default step-response time grids
- Cross spectral density and coherence
Transformations
Adaptive filters
Synchronisation
Multirate and radar
Information
Information theory and coding: source coding, LFSRs, CRC and SHA-256, error-correcting codes.
Crate lib_jsl_information: API reference · book chapters: information theory, error-correcting codes · 19 items
Source coders
LFSRs
Operators
Forward error correction
Electromagnetics
Electromagnetics: fields, antennas, arrays, beamforming, direction finding, transmission lines, propagation, MoM and FDTD.
Crate lib_jsl_electromagnetics: API reference · book chapters: fields, antennas, arrays and beamforming, transmission lines, propagation and computational methods · 39 items
Design and conventions: crates/electromagnetics/DESIGN.md
Foundations
- Conventions (units, configurable time convention, media)
- Coordinate systems
- Polarisation bases (linear, circular)
- Rigid transforms (translation, rotation)
Fields
- Domains and quadrature (surface, volume)
- Field container (scalar/vector, harmonic/time-varying, quantities)
- Coordinate conversion
- Interpolation (nearest, linear, cubic)
- Vector calculus (volume)
- Surface vector calculus (gradient, divergence, curl, Laplace-Beltrami)
- Physics operations (Poynting, power, potentials)
Antenna models
Arrays and signal models
- Sensor arrays and responses
- Point source scenes
- Distributed source and noise temperature scenes
- Covariance models
Algorithms
Transmission lines and networks
- Transmission lines (impedance transformation, standing waves)
- S-parameters and network conversions
- Smith chart
Propagation and systems
- Friis transmission and path loss
- Multipath and two-ray models
- Atmospheric attenuation
- Radar equation
Advanced algorithms
- Spherical wave expansion
- Near-field to far-field transformation
- Direction-of-arrival estimation on sensor arrays
- Method of moments (wire antennas)
- FDTD solver
Demonstrations
Discrete mathematics and geometry
Number theory, graphs and computational geometry.
Number theory
Number theory: modular arithmetic, primes, factorisation, the Chinese remainder theorem and polynomials.
Crate lib_jsl_number_theory: API reference · book chapter: number theory · 10 items
- Base exponent in modulus
- Greatest common divisor
- Integer square root
- Multiplicative inverse modulo
- Polynomial
- Text coded integer
- Prime sieves
- Primality testing (Miller-Rabin)
- Integer factorisation
- Chinese remainder theorem
Graph
Graph representations and algorithms: shortest paths, spanning trees, flows and orderings.
Crate lib_jsl_graph: API reference · book chapter: graph algorithms · 11 items
- Graph representation helpers (edge lists, adjacency)
- Shortest paths (Dijkstra, Bellman-Ford, A*)
- All-pairs shortest paths (Floyd-Warshall)
- Minimum spanning trees (Kruskal, Prim)
- Maximum flow (Edmonds-Karp, Dinic)
- Topological sort and strongly connected components
- All-pairs shortest paths (Johnson)
- k shortest loopless paths (Yen)
- Maximum bipartite matching (Hopcroft-Karp) and structural rank
- Minimum-weight full bipartite matching
- Graph Laplacians
Geometry
Geometry: 1D to 4D types, Delaunay and Voronoi, convex hulls, spatial trees, intersections and mesh processing.
Crate lib_jsl_geometry: API reference · book chapter: computational geometry · 60 items
- Common
- Concrete types
- Coordinate systems
- Geometric traits
- Registry
- Tables
- Transformation traits
- Transform support (2D and 3D helpers)
0D
1D
2D
- Conversions
- Coordinate vector 2D
- Free vector 2D
- Line 2D
- Mesh 2D
- Plane 2D
- Polygon face 2D
- Triangle 2D
- Unit vector 2D
3D
- Conversions
- Coordinate vector 3D
- Free vector 3D
- Line 3D
- Plane 3D
- Polygon face 3D
- Surface mesh 3D
- Tetrahedron 3D
- Triangle 3D
- Unit vector 3D
- Volume mesh 3D
4D
Algorithms
- Delaunay triangulation
- Convex hull
- Slicing
- Rotations
- Quaternions
- Nearest point finding
- Intersection
- k-d trees
- Octrees
- Quadtrees
- Voronoi diagrams
- Convex hulls in any dimension (n-D Quickhull)
- Delaunay triangulations in any dimension, with point location and
add_points - Furthest-site Delaunay triangulations
- Voronoi diagrams in any dimension
- Half-space intersection
- Spherical Voronoi diagrams with region areas
- Mesh smoothing and decimation
- Polygon boolean operations
- Rotation fitting (
align_vectors, Kabsch/Wahba) - Mean of rotations
- Rotation vectors, modified Rodrigues parameters and uniform random rotations
- Procrustes analysis
- Geometric slerp on the n-sphere
- Hausdorff distance
- k-d tree pair search, pair counts and periodic boxes
Foundations and input/output
Shared types, utilities, sorting and file formats.
Core
Shared foundation types, aliases, and traits for the lib_jsl workspace.
Crate lib_jsl_core: API reference · book chapter: foundations · 3 items
Utils
Terminal plots, unit conversion and numerical helpers.
Crate lib_jsl_utils: API reference · book chapter: foundations · 3 items
Sorting and selection
Sorting and selection algorithms.
Crate lib_jsl_sorting: API reference · book chapter: sorting and selection · 5 items
File IO
Readers and writers for WAV, JPEG, PNG, Netpbm, CSV, NumPy .npy and .npz, Matrix Market, MATLAB (levels 4, 5 and 7.3), IDL save files, HDF5 and NetCDF-4, Harwell-Boeing, NetCDF-3, Fortran unformatted and ARFF files.
Crate lib_jsl_file_io: API reference · book chapter: foundations · 18 items
Audio
Image
Data
- CSV files
- NumPy .npy files
- NumPy .npz archives: a ZIP reader and writer with ZIP64, stored and deflated members
- Matrix Market files
- MATLAB level-5 MAT-files
- MATLAB level-4 MAT-files and version detection
- IDL save files (
readsav), compressed or not, with pointers and structures - HDF5 files: groups, datasets, attributes, chunked and compressed data (read-only)
- MATLAB v7.3 MAT-files
- NetCDF-4 files
- Harwell-Boeing files
- NetCDF-3 files
- Fortran unformatted sequential files
- ARFF files
What the library does not cover
- Multigrid preconditioners, and complex sparse eigenvalue solvers and preconditioners
- Calling external BLAS or LAPACK, and distributed computing; parallelism is limited to the optional multithreaded matrix multiply (the
threadingfeature) - Hand-written SIMD intrinsics, except in the FFT engines
- Single precision and generic floating-point types: numerical routines compute in
f64andComplex<f64>(f32appears only in data containers and file formats) - General-purpose containers; data structures appear only where an algorithm needs them (k-d trees, union-find, graph representations, geometry tables)
- Complex number primitives (provided by
num-complex) - Arbitrary-precision arithmetic