Skip to main content

MatTrait

Trait MatTrait 

Source
pub trait MatTrait {
    // Required method
    fn shape(&self) -> (usize, usize);

    // Provided methods
    fn n_rows(&self) -> usize { ... }
    fn n_cols(&self) -> usize { ... }
    fn is_square(&self) -> bool { ... }
}
Expand description

Minimal shape-based interface shared by Mat and crate::sparse::SpMat.

Implementors only need to provide shape; the rest are derived defaults.

Required Methods§

Source

fn shape(&self) -> (usize, usize)

Provided Methods§

Source

fn n_rows(&self) -> usize

Source

fn n_cols(&self) -> usize

Source

fn is_square(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> MatTrait for Mat<R>

Source§

impl<R> MatTrait for SpMat<R>