pub struct Mat(/* private fields */);Expand description
A matrix backed by libmat’s C implementation.
Owns its underlying C allocation and frees it on drop. Uses column-major storage.
Implementations§
Source§impl Mat
impl Mat
Sourcepub fn new(rows: usize, cols: usize) -> Self
pub fn new(rows: usize, cols: usize) -> Self
Creates a zero-initialized matrix with the given dimensions.
Sourcepub fn from_slice(rows: usize, cols: usize, data: &[f32]) -> Self
pub fn from_slice(rows: usize, cols: usize, data: &[f32]) -> Self
Creates a matrix from a slice of values in column-major order.
Sourcepub fn eigvals(&self) -> Mat
pub fn eigvals(&self) -> Mat
Computes eigenvalues of a general square matrix.
Uses Hessenberg reduction followed by implicit QR iteration. For complex eigenvalues (conjugate pairs), only the real part is stored.
Sourcepub fn eigvals_sym(&self) -> Mat
pub fn eigvals_sym(&self) -> Mat
Computes eigenvalues of a symmetric matrix.
Faster than eigvals for symmetric input.
Uses tridiagonal reduction + implicit QR iteration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mat
impl RefUnwindSafe for Mat
impl !Send for Mat
impl !Sync for Mat
impl Unpin for Mat
impl UnsafeUnpin for Mat
impl UnwindSafe for Mat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more