orthos
High-performance linear algebra library written in Rust.
Installation
[]
= "0.1"
Quick Start
use ;
Features
Matrix Operations
- Creation:
zeros,ones,identity,from_rows,new - Arithmetic:
add,sub,mul_elementwise,matmul,scale - Methods:
transpose,inverse,determinant,trace - Access:
get,set,shape,rows,cols
Vector Operations
- Creation:
new,zeros,ones - Arithmetic:
add,sub,scale - Methods:
dot,norm,norm_squared,normalize - Access:
get,set,len,is_empty
Matrix-Vector Operations
orthos::ops::matvec(&matrix, &vector)- Matrix-vector multiplicationorthos::ops::matmul(&a, &b)- Matrix multiplication
Error Handling
All fallible operations return Result types:
use ;
let result: = from_rows;
match result
Error types:
MatrixError::DimensionMismatch- Incompatible dimensionsMatrixError::IndexOutOfBounds- Invalid indexMatrixError::SingularMatrix- Cannot invert singular matrixMatrixError::InvalidInput- Invalid input dataVectorError::DimensionMismatch- Incompatible vector lengthsVectorError::IndexOutOfBounds- Invalid index
Feature Flags
| Feature | Description |
|---|---|
python |
Enable Python bindings via PyO3 (optional) |
# With Python bindings
[]
= { = "0.1", = ["python"] }
Performance
Built on faer, optimized for:
- Cache-friendly memory layouts
- SIMD vectorization
- Multi-threaded operations for large matrices
Links
License
Apache-2.0