Skip to main content

MatrixView

Trait MatrixView 

Source
pub trait MatrixView<F>: MatrixDimensions {
    // Required method
    unsafe fn get_unchecked(&self, row_idx: usize, col_idx: usize) -> &F;

    // Provided method
    fn get(&self, row_idx: usize, col_idx: usize) -> Option<&F> { ... }
}
Expand description

Trait to consolidate different virtual matrices that may not be backed by an in-memory matrix with a standard column-major or row-major layout.

Note: for performance, users should still be aware of the underlying memory layout. This trait is just an organizational convenience.

Required Methods§

Source

unsafe fn get_unchecked(&self, row_idx: usize, col_idx: usize) -> &F

Get a reference to an element without bounds checking.

§Safety

The caller must ensure that col_idx and row_idx are within the bounds of the matrix.

Provided Methods§

Source

fn get(&self, row_idx: usize, col_idx: usize) -> Option<&F>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§