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§
sourcefn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>
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.
Trait Implementations§
source§impl<M: MatrixExt> AccessStrategy<M> for &dyn AccessStrategy<M>
impl<M: MatrixExt> AccessStrategy<M> for &dyn AccessStrategy<M>
source§fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>
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§impl<M: MatrixExt> AccessStrategy<M> for Box<dyn AccessStrategy<M>>
impl<M: MatrixExt> AccessStrategy<M> for Box<dyn AccessStrategy<M>>
source§fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>
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