Expand description
§NumRS2: High-Performance Numerical Computing in Rust
NumRS2 is a comprehensive numerical computing library for Rust, inspired by NumPy. It provides a powerful N-dimensional array object, sophisticated mathematical functions, and advanced linear algebra, statistical, and random number functionality.
Version 0.1.0-beta.3 - Phase 4 Complete: Advanced features including automatic differentiation, Apache Arrow integration, randomized linear algebra, and complete sparse matrix support. Production-ready with 638 tests passing and zero warnings.
§Quick Start
use numrs2::prelude::*;
let a = Array::from_vec(vec![1.0, 2.0, 3.0, 4.0]).reshape(&[2, 2]);
let b = Array::from_vec(vec![5.0, 6.0, 7.0, 8.0]).reshape(&[2, 2]);
let c = a.matmul(&b).unwrap();
println!("Matrix multiplication result: {}", c);
§Main Features
§Core Functionality
- N-dimensional Array: Core
Array
type with efficient memory layout and broadcasting - Advanced Linear Algebra:
- Matrix operations, decompositions, solvers through BLAS/LAPACK integration
- Sparse matrices (COO, CSR, CSC, DIA formats) with iterative solvers
- Randomized algorithms (randomized SVD, random projections)
- Automatic Differentiation: Forward and reverse mode AD with higher-order derivatives
- Data Interoperability:
- Apache Arrow integration for zero-copy data exchange (requires
arrow
feature) - Python bindings via PyO3 for NumPy compatibility (requires
python
feature) - Feather format support for fast columnar storage
- Apache Arrow integration for zero-copy data exchange (requires
§Performance Features
- Expression Templates: Lazy evaluation and operation fusion
- Advanced Indexing: Fancy indexing, boolean masking, conditional selection
- SIMD Acceleration: Vectorized math operations using SIMD instructions
- Parallel Computing: Multi-threaded execution with Rayon
- GPU Acceleration: Optional GPU-accelerated operations using WGPU (requires
gpu
feature)
§Additional Capabilities
- Mathematical Functions: Comprehensive set of element-wise mathematical operations
- Random Number Generation: Modern interface for various distributions
- Statistical Analysis: Descriptive statistics and probability distributions
- Type Safety: Leverage Rust’s type system for compile-time guarantees
§Optional Features
arrow
: Apache Arrow integration for zero-copy data exchangepython
: Python bindings via PyO3 for NumPy interoperabilitylapack
: LAPACK-dependent linear algebra operationsgpu
: GPU acceleration using WGPUmatrix_decomp
: Matrix decomposition functions (enabled by default)validation
: Additional runtime validation checks
Re-exports§
pub use error::NumRs2Error;
pub use error::Result;
pub use random::random_base;
Modules§
- algorithms
- High-performance numerical algorithms
- array
- array_
ops - array_
ops_ legacy - arrays
- Array operations and data structures
- autodiff
- Automatic Differentiation for NumRS2
- axis_
ops - bitwise_
ops - Bitwise operations for Arrays
- blas
- char
- String and character array operations (NumPy
char
module equivalent) - comparisons
- comparisons_
broadcast - Comparison operators with automatic broadcasting
- complex_
ops - Complex number operations for Arrays
- conversions
- error
- NumRS2 Error System
- error_
handling - Error handling configuration for NumRS2
- expr
- Expression Templates for Lazy Evaluation
- financial
- Financial Functions Module
- indexing
- interop
- Interoperability with other Rust numerical libraries
- io
- linalg
- Basic linear algebra operations with Array Includes matrix multiplication, dot product, matrix inversion, etc.
- linalg_
extended - Extended Linear Algebra Operations
- linalg_
optimized - Optimized linear algebra operations with enhanced performance algorithms
- linalg_
parallel - Parallel linear algebra operations with load balancing
- linalg_
stable - Numerically stable matrix decomposition algorithms
- masked
- math
- math_
extended - Extended Mathematical Functions
- matrix
- memory_
alloc - Custom memory allocation for numerical workloads
- memory_
optimize - Memory layout optimization for cache efficiency
- mmap
- new_
modules Deprecated - optimized_
ops - Optimized operations using scirs2-core features
- parallel
- Parallel processing enhancements and workload balancing
- parallel_
optimize - Parallel processing optimization
- prelude
- Core prelude that exports the most commonly used types and functions
- printing
- Array Printing and Display Module
- random
- Random Number Generation
- set_ops
- Set operations for arrays
- signal
- Signal Processing Module
- simd
- simd_
optimize - CPU feature detection and SIMD optimization for NumRS
- sparse
- Sparse Matrix Operations
- sparse_
enhanced - Enhanced sparse matrix operations with advanced algorithms and optimizations
- stats
- stride_
tricks - testing
- Testing Utilities for NumRS2
- traits
- Core Trait System for NumRS2
- types
- Advanced data types and type system for NumRS
- ufuncs
- unique
- unique_
optimized - util
- views
Macros§
- error_
location - Macro for creating error location from current position
- operation_
context - Macro for creating operation context with current function
- run_
tests - Convenience macro for running multiple test assertions
- simd_
array - Convenience macro for creating SIMD-optimized arrays