Expand description
Reshaping transformations for multidimensional slices and shapes. Dimensional reshaping of slices and shapes.
This module defines utilities for transforming a Slice or
Shape by factoring large extents into smaller ones under a
given limit. The result is a reshaped view with increased
dimensionality and preserved memory layout.
This is useful for hierarchical routing, structured fanout, and other multidimensional layout transformations.
For Shapes, reshaping also expands dimension labels using a
label/N naming convention, preserving the semantics of the
original shape in the reshaped reshape_with_limit.
See [reshape_with_limit] and [reshape_shape] for entry points.
Modules§
- prelude
- For convenient
slice.reshape_with_limit(),shape.reshape()syntax,use reshape::prelude::*.
Structs§
- Limit
- A shaping constraint that bounds the maximum extent allowed in any reshaped dimension.
- Reshaped
Shape - A reshaped version of a
Shape, with factored dimensions and updated labels.
Enums§
Traits§
- Reshape
Shape Ext - Extension trait for reshaping
Shapes by factoring large dimensions. - Reshape
Slice Ext - A trait for types that can be reshaped into a higher-dimensional view by factoring large extents into smaller ones.
Functions§
- expand_
labels - Expands factored dimension labels into one label per subdimension.
- reshape_
selection - Maps a
Selectionon aSliceto a newSelectionthat selects all ranks in the reshapedSlicethat the originalSelectionselected in the originalSlice - reshape_
shape - Reshapes a labeled
Shapeby factoring large extents into smaller ones, producing a new shape with expanded dimensionality and updated labels. - reshape_
with_ limit - Reshapes a slice by factoring each dimension into smaller extents under the given limit.
- to_
original_ coord - Constructs a function that maps coordinates from the reshaped slice back to equivalent coordinates in the original slice, preserving their flat (linear) position.
- to_
reshaped_ coord - Constructs a function that maps coordinates from the original slice to equivalent coordinates in the reshaped slice, preserving their flat (linear) position.
Type Aliases§
- Coord
- Coordinate vector used throughout reshape logic. Semantically represents a point in multidimensional space.