Expand description
Types to describe extents, points and views.
The purpose of this module is to provide data structures to efficiently
describe subsets of nonnegative integers, called ranks, represented by
usize
values. Ranks are organized into multi-dimensional spaces in which
each discrete point is a rank, mapped in row-major order.
These dimensions represent a space that carry semantic meaning, such that ranks are usually sub-set along some dimension of the space. For example, ranks may be organized into a space with dimensions “replica”, “host”, “gpu”, and we’d expect to subset along these dimensions, for example to select all GPUs in a given replica.
This alignment helps provide a simple and efficient representation, internally
in the form of crate::Slice
, comprising an offset, sizes, and strides that
index into the space.
Extent
: the shape of the space, naming each dimension and specifying their sizes.Point
: a specific coordinate in an extent, together with its linearized rank.Region
: a (possibly sparse) hyper-rectangle of ranks within a larger extent. Since it is always rectangular, it also defines its own extent.View
: a collection of items indexed byRegion
. Views provide standard manipulation operations and use ranks as an efficient indexing scheme.
Structs§
- Coord
Iter - An iterator over the coordinates of a
Point
in row-major order. - Extent
Extent
defines the logical shape of a multidimensional space by assigning a size to each named dimension. It abstracts away memory layout and focuses solely on structure — what dimensions exist and how many elements each contains.- Extent
Points Iterator - An iterator for points in an extent.
- Invalid
Cardinality - A canonical cardinality mismatch descriptor.
- Point
Point
represents a specific coordinate within the multi-dimensional space defined by anExtent
.- Region
Region
describes a region of a possibly-larger space of ranks, organized into a hyperrect.- View
Iterator - An iterator over views.
Enums§
- Extent
Error - Errors that can occur when constructing or validating an
Extent
. - Point
Error - Errors that can occur when constructing or evaluating a
Point
. - Region
Error - Errors that occur while operating on Region.
- Region
Parse Error - View
Error - Errors that occur while operating on views.
Traits§
- Build
From Region - Dense builder: constructs a mesh from a complete sequence of
values in the canonical order for
region
. - Build
From Region Indexed - Indexed builder: constructs a mesh from sparse
(rank, value)
pairs. - Collect
Exact Mesh Ext - Exact-size, mesh-aware collecting adapter.
- Collect
Indexed Mesh Ext - Indexed collecting adapter.
- Collect
Mesh Ext - Mesh-aware collecting adapter.
- InExtent
- Extension trait for creating a
Point
from a coordinate vector and anExtent
. - MapInto
Ext - Map into any mesh
M
. - Ranked
- Ranked is a helper trait to implement
View
on a ranked collection of items. - Ranked
Sliceable - Extension of
Ranked
for types that can materialize a new owned view. - View
- A View is a collection of items in a space indexed by a
Region
. - ViewExt
- Extension methods for view construction.