Skip to main content

u_numflow/
lib.rs

1//! # u-numflow
2//!
3//! Foundational mathematical primitives.
4//!
5//! This crate provides foundational mathematical, statistical, and probabilistic
6//! building blocks that are domain-agnostic. It knows nothing about scheduling,
7//! nesting, geometry, or any consumer domain.
8//!
9//! ## Modules
10//!
11//! - [`stats`] — Descriptive statistics with numerical stability guarantees
12//! - [`distributions`] — Probability distributions (Uniform, Triangular, PERT, Normal, LogNormal, Weibull)
13//! - [`special`] — Special mathematical functions (normal CDF, inverse normal CDF)
14//! - [`matrix`] — Dense matrix operations (multiply, determinant, inverse, Cholesky)
15//! - [`random`] — Random number generation, shuffling, and weighted sampling
16//! - [`collections`] — Specialized data structures (Union-Find)
17//! - [`transforms`] — Box-Cox power transformation
18//! - [`fourier`] — Discrete Fourier transform of any length (radix-2 / Bluestein)
19//! - [`optimize`] — Derivative-free local minimisation (Nelder–Mead)
20//!
21//! ## Design Philosophy
22//!
23//! - **Numerical stability first**: Welford's algorithm for variance,
24//!   Neumaier summation for accumulation
25//! - **Reproducibility**: Seeded RNG support for deterministic experiments
26//! - **Property-based testing**: Mathematical invariants verified via proptest
27
28/// This crate's version, as published (`CARGO_PKG_VERSION`) — for a consumer
29/// that reports what it was built against without reading a lock file.
30///
31/// ```
32/// assert!(!u_numflow::VERSION.is_empty());
33/// ```
34pub const VERSION: &str = env!("CARGO_PKG_VERSION");
35
36pub mod collections;
37pub mod distributions;
38pub mod fourier;
39pub mod matrix;
40pub mod optimize;
41pub mod random;
42pub mod special;
43pub mod stats;
44pub mod transforms;
45pub mod units;
46
47#[cfg(feature = "ffi")]
48pub mod ffi;
49#[cfg(feature = "wasm")]
50pub mod wasm;
51
52#[cfg(all(test, feature = "wasm"))]
53mod engine_card;
54#[cfg(any(feature = "wasm", feature = "ffi"))]
55mod wire;
56
57// The README's Rust examples are the first code most users copy, so they are
58// compiled and run with the doc-tests. Without this they were checked by
59// nothing.
60#[cfg(doctest)]
61#[doc = include_str!("../README.md")]
62pub struct ReadmeDoctests;