Expand description
§Tensor Operations: Matrix and Linear Algebra in Rust
This library provides two implementations of matrix operations:
-
Manual Implementation (
manualmodule): Pure Rust implementation from scratch- Educational purpose to understand algorithms
- No external dependencies for core operations
- Good for learning linear algebra concepts
-
Optimized Implementation (
optimizedmodule): High-performance using nalgebra- Production-ready code
- Uses BLAS-optimized linear algebra
- 10-1000x faster than manual implementation
§Quick Start
use tensor_operations::manual::Matrix;
// Create a matrix
let a = Matrix::new(vec![
vec![1.0, 2.0],
vec![3.0, 4.0],
]).unwrap();
// Matrix operations
let b = Matrix::new(vec![
vec![5.0, 6.0],
vec![7.0, 8.0],
]).unwrap();
let sum = a.add(&b).unwrap();
let product = a.mul(&b).unwrap();
let det = a.determinant().unwrap();
let inv = a.inverse().unwrap();Re-exports§
pub use manual::Matrix;pub use optimized::OptimizedMatrix;