pub struct Dimension { /* private fields */ }Expand description
XDL array dimension descriptor
Implementations§
Source§impl Dimension
impl Dimension
Sourcepub fn n_elements(&self) -> usize
pub fn n_elements(&self) -> usize
Calculate total number of elements
Sourcepub fn linear_index(&self, indices: &[usize]) -> Result<usize, XdlError>
pub fn linear_index(&self, indices: &[usize]) -> Result<usize, XdlError>
Convert multidimensional index to linear index
Sourcepub fn multi_index(&self, linear_idx: usize) -> Result<Vec<usize>, XdlError>
pub fn multi_index(&self, linear_idx: usize) -> Result<Vec<usize>, XdlError>
Convert linear index to multidimensional indices
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dimension
impl<'de> Deserialize<'de> for Dimension
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 Eq for Dimension
impl StructuralPartialEq for Dimension
Auto Trait Implementations§
impl Freeze for Dimension
impl RefUnwindSafe for Dimension
impl Send for Dimension
impl Sync for Dimension
impl Unpin for Dimension
impl UnwindSafe for Dimension
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