Skip to main content

Documentation 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.

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 (including 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

cargo add mathcore
Both methods add MathCore with its default features enabled (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 minimal no_std core up to the full-featured default build.
FeatureDefaultDescription
stdEnables standard-library support: std::collections::HashMap, std-backed error types via thiserror, and nom/nalgebra std integration.
parallelRayon-based data parallelism for matrix and batch operations. Requires std.
fftFast Fourier Transform support via rustfft. Requires std.
fullAlias 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, no parallelism, no FFT.
# Safe for embedded and bare-metal targets.
mathcore = { version = "0.3.1", default-features = false }

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 by alloc::collections::BTreeMap instead of std::collections::HashMap.
  • thiserror, nom, and nalgebra all fall back to their no_std/alloc modes.
  • rayon and rustfft are not available (both require std).
[dependencies]
mathcore = { version = "0.3.1", default-features = false }
Disabling the std feature also disables parallel and fft automatically, because both declare std as a dependency in their feature definitions. You do not need to list them explicitly.

Dependencies

MathCore pulls in the following crates. All are widely used, well-maintained libraries with their own no_std support paths:
CrateVersionRole
nom7.1Expression parser combinators
num-complex0.4Complex number arithmetic
num-traits0.2Numeric trait abstractions
num-bigint0.4Arbitrary-precision integers
num-rational0.4Exact rational arithmetic (backed by num-bigint)
nalgebra0.32Matrix and linear algebra operations
thiserror2.0Ergonomic error-type derivation
rayon1.7Data parallelism (optional, parallel feature)
rustfft6.1Fast 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:
cargo test
You should see output ending with:
test result: ok. X passed; 0 failed; 0 ignored
To run the bundled demo that exercises arithmetic, differentiation, integration, equation solving, and ASCII plotting, use:
cargo run --example demo
To build optimised release artefacts (uses LTO and opt-level = 3 as configured in Cargo.toml):
cargo build --release
To browse the API documentation locally, run cargo doc --open. This builds and opens the full rustdoc output in your browser without needing an internet connection.

Build docs developers (and LLMs) love