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.
§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
- N-dimensional Array: Core
Array
type with efficient memory layout and broadcasting - Linear Algebra: Matrix operations, decompositions, solvers through BLAS/LAPACK integration
- Mathematical Functions: Comprehensive set of element-wise mathematical operations
- SIMD Acceleration: Vectorized math operations using SIMD instructions
- Parallel Computing: Multi-threaded execution with Rayon
- Random Number Generation: Modern interface for various distributions
- GPU Acceleration: Optional GPU-accelerated array operations using WGPU
- Type Safety: Leverage Rust’s type system for compile-time guarantees
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
- axis_
ops - blas
- char
- String and character array operations (NumPy
char
module equivalent) - comparisons
- conversions
- error
- NumRS2 Error System
- 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 - 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 - 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
- simd_
array - Convenience macro for creating SIMD-optimized arrays