pub struct Block {
pub range: Range<usize>,
pub dims: Vec<usize>,
pub axes: Vec<Option<(usize, bool)>>,
}Expand description
A contiguous block of storage that a view reads, each item once, with the block’s axes in another order and some of them backwards. Mapping::block finds one.
Fields§
§range: Range<usize>The items of storage that the view reads.
dims: Vec<usize>The block’s shape, outermost axis first, leaving out the view’s axes of length 1.
axes: Vec<Option<(usize, bool)>>For each axis of the view, the block axis it walks and whether it walks backwards. None for an axis of length 1.
Implementations§
Source§impl Block
impl Block
Sourcepub fn fold(&self, axis: Option<usize>) -> ([usize; 3], Option<Vec<Steps>>)
pub fn fold(&self, axis: Option<usize>) -> ([usize; 3], Option<Vec<Steps>>)
How a reduction folds the view over its axis axis, or over every item for None, by folding the block in its own order: the [outer, len, inner] dimensions to fold the block’s items along their middle, and the tables that read the totals in the order of the view’s other axes, where they come in another order. A reduction combines a lane’s items in any order, so these totals are the view’s.
Trait Implementations§
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Forget for Block
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more