Skip to main content

Module view

Module view 

Source
Expand description

Julia-like dynamic-rank strided view types.

This module provides the canonical view types for strided operations, matching Julia’s StridedViews.jl data model:

  • StridedView: Immutable dynamic-rank strided view with lazy element operations
  • StridedViewMut: Mutable dynamic-rank strided view (Identity op only)
  • StridedArray: Owned strided multidimensional array

A view’s shape and strides are a small inline-or-heap container with capacity crate::INLINE_RANK: every constructor, clone, and metadata transform allocates nothing up to that rank and spills gracefully above it. The view itself only borrows the element data.

The metadata container is tinyvec::ArrayVec, unified across tensor4all repositories (tensor4all-agent-rules#22, strided-rs#312). ArrayVec is Copy for Copy items, so a clone is one fixed-size bitwise copy, and the heap fallback for rank above INLINE_RANK lives in a separate Option<Box<SpilledMeta>> so the inline value has no drop glue.

Structs§

StridedArray
Owned strided multidimensional array.
StridedView
Dynamic-rank immutable strided view with lazy element operations.
StridedViewMut
Dynamic-rank mutable strided view.

Functions§

col_major_strides
Compute column-major strides (Julia default: first index varies fastest).
row_major_strides
Compute row-major strides (C default: last index varies fastest).