Table of Contents

Struct np.NDIndexSpans

Namespace
NumSharp
Assembly
NumSharp.dll

The foreach-able returned by AsSpans() — the allocation-free odometer. Yields the current multi-index as a ReadOnlySpan<T> over a buffer REUSED each step (C-order, last axis fastest — identical order to np.NDIndex), so an entire index-space walk allocates nothing per step.

Re-enumeration RESTARTS (each foreach builds a fresh enumerator with its own buffer) — deliberately unlike np.NDIndex, which is its own iterator (NumPy's iter(i) is i) and resumes. Copy the span (.ToArray()) to keep an index past the current iteration; storing the span itself, or the whole enumeration, is a use-after-overwrite.

public readonly struct np.NDIndexSpans
Inherited Members

Methods

GetEnumerator()

Builds a fresh odometer with its own reused coordinate buffer.

public np.NDIndexSpans.Enumerator GetEnumerator()

Returns

np.NDIndexSpans.Enumerator