Table of Contents

Struct np.FlatRefIter<T>

Namespace
NumSharp
Assembly
NumSharp.dll

The foreach-able returned by flat<T>(NDArray, bool) and AsTyped<T>(bool) — the typed, unboxed, by-reference flat iterator. Yields ref T in logical C-order (matching flatiter), write-through for every memory layout.

It is exactly a C-order np.NDRefIter<T>. This type reuses np.NDRefIter<T>.Enumerator verbatim — the same NDIterRef cursor that np.nditer<T> drives — pinned to NPY_CORDER. It exists as its own type only so the flat contract (always C-order, never memory order) is stated in the type rather than left to a parameter default; there is no separate iteration logic. Everything documented on np.NDRefIter<T> — why the enumerator is a ref struct, that this value holds no unmanaged state while the enumerator does, that foreach disposes it and re-enumeration restarts — applies identically.

public readonly struct np.FlatRefIter<T> where T : unmanaged

Type Parameters

T

The array's exact element type.

Inherited Members
Extension Methods

Methods

GetEnumerator()

Builds a fresh C-order iterator; foreach disposes it for you. Reuses np.NDRefIter<T>.Enumerator so the walk is byte-for-byte the one np.nditer<T>(op, order: 'C') produces.

public np.NDRefIter<T>.Enumerator GetEnumerator()

Returns

np.NDRefIter<T>.Enumerator