OxiBLAS Matrix - Matrix types and views for OxiBLAS.
This crate provides the core matrix types for OxiBLAS:
- [
Mat<T>]: Owned, heap-allocated matrix with column-major storage - [
CowMat<T>]: Copy-on-Write matrix for efficient sharing - [
MatRef<'a, T>]: Immutable view into a matrix - [
MatMut<'a, T>]: Mutable view with reborrow semantics
Specialized Matrix Types
- [
packed::PackedMat<T>]: Packed triangular/symmetric storage - [
banded::BandedMat<T>]: Banded matrix storage - [
triangular::TriangularMat<T>]: Triangular matrix with packed storage - [
symmetric::SymmetricMat<T>]: Symmetric matrix with packed storage - [
symmetric::HermitianMat<T>]: Hermitian matrix with packed storage
Memory Layout
All matrices use column-major (Fortran) storage order. This means elements within a column are contiguous in memory. The storage is aligned for efficient SIMD operations.
Views and Reborrows
The view types (MatRef, MatMut) do not own their data. They can
represent submatrices, transposed views, or any strided data.
MatMut uses the reborrow pattern to prevent aliasing:
rb()creates an immutable reborrowrb_mut()creates a mutable reborrow with a shorter lifetime
Example
use ;
// Create a matrix
let mut m: = zeros;
// Modify through a mutable view
// Read through an immutable view
let view = m.as_ref;
assert_eq!;