Trait rds_tensors::tindex::TIndex
[−]
[src]
pub trait TIndex { fn inc_ro(&mut self, shape: &[usize]); fn dec_ro(&mut self, shape: &[usize]); fn inc_co(&mut self, shape: &[usize]); fn dec_co(&mut self, shape: &[usize]); fn is_zero(&mut self) -> bool; fn to_pos(&self, shape: &[usize], strides: &[usize]) -> usize; }
A trait which adds indexing functions to simplify index manipulation.
Required Methods
fn inc_ro(&mut self, shape: &[usize])
Increment an index in the row-major order.
fn dec_ro(&mut self, shape: &[usize])
Decrement an index in the row-major order.
fn inc_co(&mut self, shape: &[usize])
Increment an index in the column-major order.
fn dec_co(&mut self, shape: &[usize])
Decrement an index in the column-major order.
fn is_zero(&mut self) -> bool
Return true if the index is zero for all dimensions.
fn to_pos(&self, shape: &[usize], strides: &[usize]) -> usize
Compute the resulting position in a linear storage array.