SciRS2: Scientific Computing in Rust — All-in-One Meta-Crate
scirs2 is the all-in-one convenience meta-crate for the SciRS2 scientific computing ecosystem. It re-exports the complete set of SciRS2 sub-crates through a unified interface, so you can depend on a single crate and enable only the domains you need via Cargo feature flags.
If you prefer minimal compile times and finer dependency control, use the individual sub-crates directly (e.g., scirs2-linalg, scirs2-stats). If you want the full ecosystem available in one dependency, use this crate.
Installation
Add the meta-crate to your Cargo.toml:
[]
= "0.3.1"
With only the sub-crates you need (recommended for production):
[]
= { = "0.3.1", = false, = ["linalg", "stats", "optimize"] }
For the complete ecosystem:
[]
= { = "0.3.1", = ["full"] }
Or depend on individual sub-crates directly for fastest compile times:
[]
= "0.3.1"
= "0.3.1"
= "0.3.1"
Feature Flags
Each sub-crate is gated behind a feature flag of the same name. default enables the standard feature group.
Feature Groups
| Feature | Includes |
|---|---|
standard |
linalg, stats, integrate, interpolate, optimize, fft, special, signal, sparse, spatial, cluster, transform, metrics |
ai |
neural, autograd |
experimental |
ndimage, neural, series, text, io, datasets, graph, vision, autograd |
full |
standard + experimental |
Individual Feature Flags
| Feature | Sub-crate | Description |
|---|---|---|
linalg |
scirs2-linalg |
Linear algebra: decompositions, solvers, matrix functions |
stats |
scirs2-stats |
Distributions, hypothesis testing, Bayesian methods |
integrate |
scirs2-integrate |
ODE/PDE solvers, quadrature, Monte Carlo integration |
interpolate |
scirs2-interpolate |
Splines, RBF, MLS, kriging, barycentric interpolation |
optimize |
scirs2-optimize |
Unconstrained/constrained/global optimization, metaheuristics |
fft |
scirs2-fft |
FFT, DCT/DST, NUFFT, wavelet packets, spectral analysis |
oxifft |
scirs2-fft (OxiFFT) |
High-performance pure-Rust FFT via OxiFFT backend |
special |
scirs2-special |
Special functions: Bessel, gamma, elliptic, hypergeometric |
signal |
scirs2-signal |
Signal processing: filters, STFT, Kalman, source separation |
sparse |
scirs2-sparse |
Sparse matrix formats (CSR/CSC/COO), sparse solvers |
spatial |
scirs2-spatial |
KD-tree, R*-tree, Voronoi, convex hull, geodata |
cluster |
scirs2-cluster |
K-means, DBSCAN, GMM, hierarchical, spectral clustering |
transform |
scirs2-transform |
PCA, ICA, UMAP, t-SNE, NMF, metric learning |
metrics |
scirs2-metrics |
Classification, regression, ranking, segmentation metrics |
ndimage |
scirs2-ndimage |
N-dimensional image processing: morphology, segmentation |
neural |
scirs2-neural |
Neural networks, transformers, GNNs, training utilities |
autograd |
scirs2-autograd |
Automatic differentiation, higher-order gradients, JVP/VJP |
series |
scirs2-series |
Time series: ARIMA, Prophet, state-space, forecasting |
text |
scirs2-text |
NLP: tokenization, NER, topic models, embeddings |
io |
scirs2-io |
Data I/O: CSV, JSON, HDF5-lite, Parquet-lite, Arrow |
datasets |
scirs2-datasets |
Benchmark datasets and synthetic data generators |
graph |
scirs2-graph |
Graph algorithms, GNNs, community detection |
vision |
scirs2-vision |
Computer vision: feature detection, stereo, depth |
Re-exported Sub-crates
All sub-crates are accessible as top-level modules when their feature is enabled:
| Module path | Feature flag | Domain |
|---|---|---|
scirs2::core |
always | Core utilities, SIMD, GPU, memory |
scirs2::linalg |
linalg |
Linear algebra |
scirs2::stats |
stats |
Statistics and probability |
scirs2::integrate |
integrate |
Numerical integration and ODEs |
scirs2::interpolate |
interpolate |
Interpolation |
scirs2::optimize |
optimize |
Optimization |
scirs2::fft |
fft |
Fourier transforms |
scirs2::special |
special |
Special functions |
scirs2::signal |
signal |
Signal processing |
scirs2::sparse |
sparse |
Sparse matrices |
scirs2::spatial |
spatial |
Spatial algorithms |
scirs2::cluster |
cluster |
Clustering |
scirs2::transform |
transform |
Dimensionality reduction |
scirs2::metrics |
metrics |
Evaluation metrics |
scirs2::ndimage |
ndimage |
Image processing |
scirs2::neural |
neural |
Neural networks |
scirs2::autograd |
autograd |
Automatic differentiation |
scirs2::series |
series |
Time series analysis |
scirs2::text |
text |
Natural language processing |
scirs2::io |
io |
Data input/output |
scirs2::datasets |
datasets |
Datasets and benchmarks |
scirs2::graph |
graph |
Graph algorithms |
scirs2::vision |
vision |
Computer vision |
Quick Start Examples
Linear Algebra + Statistics
use *;
use array;
Optimization + Special Functions
use ;
Signal Processing + FFT
use ;
use Array1;
Neural Network + Autograd
use ;
Architecture
SciRS2 follows a strict layered architecture per the SciRS2 Ecosystem Policy:
scirs2 (meta-crate, re-exports all)
├── scirs2-core ← Only crate allowed external dependencies (OxiBLAS, OxiFFT, etc.)
├── Scientific Computing Layer
│ ├── scirs2-linalg ← Linear algebra
│ ├── scirs2-stats ← Statistics
│ ├── scirs2-optimize ← Optimization
│ ├── scirs2-integrate ← Integration / ODEs
│ ├── scirs2-interpolate ← Interpolation
│ ├── scirs2-fft ← Fourier analysis
│ ├── scirs2-special ← Special functions
│ ├── scirs2-signal ← Signal processing
│ ├── scirs2-sparse ← Sparse matrices
│ └── scirs2-spatial ← Spatial algorithms
├── Machine Learning Layer
│ ├── scirs2-cluster ← Clustering
│ ├── scirs2-transform ← Dimensionality reduction
│ ├── scirs2-metrics ← Evaluation metrics
│ ├── scirs2-neural ← Neural networks
│ └── scirs2-autograd ← Automatic differentiation
└── Application Layer
├── scirs2-ndimage ← Image processing
├── scirs2-series ← Time series
├── scirs2-graph ← Graph algorithms
├── scirs2-vision ← Computer vision
├── scirs2-text ← NLP
├── scirs2-io ← Data I/O
└── scirs2-datasets ← Datasets
Key Design Principles
- Pure Rust by Default: Zero C/Fortran dependencies. OxiBLAS replaces OpenBLAS; OxiFFT replaces FFTW. All optional C-backed features are feature-gated.
- Core-Only External Dependencies: Only
scirs2-corelinks to external libraries. All other crates usescirs2-coreabstractions. - No
unwrap(): The entire ecosystem enforces proper error propagation throughResult. - Workspace-Unified: All crates share the same version, edition, and lint configuration from the workspace root
Cargo.toml.
Performance
SciRS2 v0.3.1 delivers production-grade performance:
- SIMD Acceleration: AVX2/AVX-512/NEON paths for 3-12x speedups on element-wise operations
- GPU Backends: Metal (Apple Silicon), with CUDA and ROCm planned for v0.4.0
- Pure Rust FFT: OxiFFT backend for competitive FFT throughput without C dependencies
- Parallel Algorithms: Rayon-based parallel iterators in compute-intensive paths
- Memory-Efficient: Buddy/Slab/Compaction allocators, arena allocators for hot paths
Contributing
See CONTRIBUTING.md for contribution guidelines.
License
Apache License 2.0. See LICENSE for details.
Copyright COOLJAPAN OU (Team Kitasan)