pub struct AffineDelinearizeIndexOperation<'c> { /* private fields */ }
Expand description
A delinearize_index
operation. Delinearize an index.
The affine.delinearize_index
operation takes a single index value and
calculates the multi-index according to the given basis.
Example:
%indices:3 = affine.delinearize_index %linear_index into (%c16, %c224, %c224) : index, index, index
In the above example, %indices:3
conceptually holds the following:
#map0 = affine_map<()[s0] -> (s0 floordiv 50176)>
#map1 = affine_map<()[s0] -> ((s0 mod 50176) floordiv 224)>
#map2 = affine_map<()[s0] -> (s0 mod 224)>
%indices_0 = affine.apply #map0()[%linear_index]
%indices_1 = affine.apply #map1()[%linear_index]
%indices_2 = affine.apply #map2()[%linear_index]
Implementations§
source§impl<'c> AffineDelinearizeIndexOperation<'c>
impl<'c> AffineDelinearizeIndexOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> AffineDelinearizeIndexOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> AffineDelinearizeIndexOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn multi_index(&self) -> impl Iterator<Item = OperationResult<'c, '_>>
pub fn linear_index(&self) -> Result<Value<'c, '_>, Error>
pub fn basis(&self) -> impl Iterator<Item = Value<'c, '_>>
Trait Implementations§
source§impl<'c> From<AffineDelinearizeIndexOperation<'c>> for Operation<'c>
impl<'c> From<AffineDelinearizeIndexOperation<'c>> for Operation<'c>
source§fn from(operation: AffineDelinearizeIndexOperation<'c>) -> Self
fn from(operation: AffineDelinearizeIndexOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for AffineDelinearizeIndexOperation<'c>
impl<'c> !Send for AffineDelinearizeIndexOperation<'c>
impl<'c> !Sync for AffineDelinearizeIndexOperation<'c>
impl<'c> Unpin for AffineDelinearizeIndexOperation<'c>
impl<'c> UnwindSafe for AffineDelinearizeIndexOperation<'c>
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