This page covers everything you need to add MathCore to a Rust project: the two installation methods, a full breakdown of the available feature flags (includingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Nonanti/mathcore/llms.txt
Use this file to discover all available pages before exploring further.
no_std configuration), the underlying dependencies, and a quick verification step to confirm your setup is working correctly.
Requirements
- Rust 1.65 or later (MathCore uses the 2021 edition)
- Cargo (ships with the standard Rust toolchain)
Installation Methods
std, parallel, and fft). See the Feature Flags section below to customise the build.
Feature Flags
MathCore’s feature system lets you pick exactly the capabilities you need, from a minimalno_std core up to the full-featured default build.
| Feature | Default | Description |
|---|---|---|
std | ✅ | Enables standard-library support: std::collections::HashMap, std-backed error types via thiserror, and nom/nalgebra std integration. |
parallel | ✅ | Rayon-based data parallelism for matrix and batch operations. Requires std. |
fft | ✅ | Fast Fourier Transform support via rustfft. Requires std. |
full | ❌ | Alias that explicitly enables std, parallel, and fft together. |
The
default feature set is ["std", "parallel", "fft"]. In a standard Rust project targeting a desktop or server environment, you can omit the features key entirely and get all three.Choosing a configuration
no_std usage
MathCore’s root crate is declared #![no_std] and depends only on alloc at its core, so it can target embedded systems and other bare-metal environments. When std is disabled:
HashMap<K, V>is backed byalloc::collections::BTreeMapinstead ofstd::collections::HashMap.thiserror,nom, andnalgebraall fall back to theirno_std/allocmodes.rayonandrustfftare not available (both requirestd).
Dependencies
MathCore pulls in the following crates. All are widely used, well-maintained libraries with their ownno_std support paths:
| Crate | Version | Role |
|---|---|---|
nom | 7.1 | Expression parser combinators |
num-complex | 0.4 | Complex number arithmetic |
num-traits | 0.2 | Numeric trait abstractions |
num-bigint | 0.4 | Arbitrary-precision integers |
num-rational | 0.4 | Exact rational arithmetic (backed by num-bigint) |
nalgebra | 0.32 | Matrix and linear algebra operations |
thiserror | 2.0 | Ergonomic error-type derivation |
rayon | 1.7 | Data parallelism (optional, parallel feature) |
rustfft | 6.1 | Fast Fourier Transform (optional, fft feature) |
nalgebra uses libm for floating-point math in no_std builds, so it does not require a system math library.Verifying Your Installation
After adding MathCore, confirm everything compiles and the test suite passes:opt-level = 3 as configured in Cargo.toml):
