pub struct Shape { /* private fields */ }
Implementations§
Source§impl Shape
impl Shape
Sourcepub fn new(shape_vals: Vec<usize>) -> Self
pub fn new(shape_vals: Vec<usize>) -> Self
Create instance of shape object for stride calculation
Sourcepub fn idx(&self, indices: Vec<usize>) -> usize
pub fn idx(&self, indices: Vec<usize>) -> usize
Produce 1d index from ndarray using higher rank index coordinates
Sourcepub fn indices(&self, index: usize, rank: usize) -> Vec<usize>
pub fn indices(&self, index: usize, rank: usize) -> Vec<usize>
Produce multi index coordinate with 1d index supplied
Sourcepub fn multi_index(&self, flat_index: usize) -> Vec<usize>
pub fn multi_index(&self, flat_index: usize) -> Vec<usize>
Get associated multi dimensional index with a single index
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Shape
impl<'de> Deserialize<'de> for Shape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more