Trait matrixable::req::AccessStrategy

source ·
pub trait AccessStrategy<M: MatrixExt> {
    // Required methods
    fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>;
    fn nrows(&self, m: &M) -> usize;
    fn ncols(&self, m: &M) -> usize;
}
Expand description

A strategy trait for access to matrix elements.

Required Methods§

source

fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>

Gives the location (if it exists) of the element in a matrix that should match the indexes (subscripts) provided according to the access strategy.

A return of None is interpereted an out of bound access.

source

fn nrows(&self, m: &M) -> usize

Gives the number of rows for the Access matrix defined by the AccessStrategy.

source

fn ncols(&self, m: &M) -> usize

Gives the number of columns for the Access matrix defined by the AccessStrategy.

Trait Implementations§

source§

impl<M: MatrixExt> AccessStrategy<M> for &dyn AccessStrategy<M>

source§

fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>

Gives the location (if it exists) of the element in a matrix that should match the indexes (subscripts) provided according to the access strategy. Read more
source§

fn nrows(&self, m: &M) -> usize

Gives the number of rows for the Access matrix defined by the AccessStrategy.
source§

fn ncols(&self, m: &M) -> usize

Gives the number of columns for the Access matrix defined by the AccessStrategy.
source§

impl<M: MatrixExt> AccessStrategy<M> for Box<dyn AccessStrategy<M>>

source§

fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>

Gives the location (if it exists) of the element in a matrix that should match the indexes (subscripts) provided according to the access strategy. Read more
source§

fn nrows(&self, m: &M) -> usize

Gives the number of rows for the Access matrix defined by the AccessStrategy.
source§

fn ncols(&self, m: &M) -> usize

Gives the number of columns for the Access matrix defined by the AccessStrategy.

Implementations on Foreign Types§

source§

impl<M: MatrixExt> AccessStrategy<M> for Box<dyn AccessStrategy<M>>

source§

fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>

source§

fn nrows(&self, m: &M) -> usize

source§

fn ncols(&self, m: &M) -> usize

source§

impl<M: MatrixExt, S: AccessStrategy<M>> AccessStrategy<M> for &S

source§

fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>

source§

fn nrows(&self, m: &M) -> usize

source§

fn ncols(&self, m: &M) -> usize

Implementors§