Expand description
Matrix types for tropical algebra.
This module provides faer-inspired matrix types:
Mat<S>: Owned matrix storing semiring valuesMatRef<'a, S>: Immutable view over scalar dataMatMut<'a, S>: Mutable view over semiring data
§Example
use tropical_gemm::{Mat, MatRef, MaxPlus};
// Create a view from raw data
let data = [1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0];
let a = MatRef::<MaxPlus<f32>>::from_slice(&data, 2, 3);
let b = MatRef::<MaxPlus<f32>>::from_slice(&data, 3, 2);
// Matrix multiplication using method
let c = a.matmul(&b);
// Or using operator syntax
let c = &a * &b;
// Factory methods
let zeros = Mat::<MaxPlus<f32>>::zeros(3, 3);
let identity = Mat::<MaxPlus<f32>>::identity(3);Structs§
- Mat
- Owned matrix storing semiring values.
- MatMut
- Mutable view over semiring data.
- MatRef
- Immutable view over scalar data interpreted as a tropical matrix.
- MatWith
Argmax - Result of matrix multiplication with argmax tracking.