Table of Contents

Class NDIterator<TOut>

Namespace
NumSharp
Assembly
NumSharp.dll
public class NDIterator<TOut> : NDIterator, IEnumerable<TOut>, IEnumerable, IDisposable where TOut : unmanaged

Type Parameters

TOut
Inheritance
NDIterator<TOut>
Implements
Inherited Members
Extension Methods

Constructors

NDIterator(IArraySlice, Shape, Shape?, bool)

public NDIterator(IArraySlice slice, Shape shape, Shape? broadcastedShape, bool autoReset = false)

Parameters

slice IArraySlice
shape Shape
broadcastedShape Shape?
autoReset bool

NDIterator(IMemoryBlock, Shape, Shape?, bool)

public NDIterator(IMemoryBlock block, Shape shape, Shape? broadcastedShape, bool autoReset = false)

Parameters

block IMemoryBlock
shape Shape
broadcastedShape Shape?
autoReset bool

NDIterator(UnmanagedStorage, bool)

public NDIterator(UnmanagedStorage storage, bool autoReset = false)

Parameters

storage UnmanagedStorage
autoReset bool

NDIterator(NDArray, bool)

public NDIterator(NDArray arr, bool autoReset = false)

Parameters

arr NDArray
autoReset bool

Fields

AutoReset

Does this iterator resets automatically when it finishes?

public bool AutoReset

Field Value

bool

Remarks

When this is true, HasNext always returns true.

Block

public readonly IMemoryBlock Block

Field Value

IMemoryBlock

BroadcastedShape

The broadcasted version of Shape.

public Shape? BroadcastedShape

Field Value

Shape?

Remarks

Might be null when iterating a non-broadcasted class

HasNext

Returns a function that when called, checks if there is a next element in this iterator.

public Func<bool> HasNext

Field Value

Func<bool>

MoveNext

Returns a function that when called, moves to next iteration and return the next value.

public Func<TOut> MoveNext

Field Value

Func<TOut>

Remarks

Make sure to check HasNext first.

MoveNextReference

Returns a function that when called, moves to next iteration and return a reference to the next value.

public MoveNextReferencedDelegate<TOut> MoveNextReference

Field Value

MoveNextReferencedDelegate<TOut>

Remarks

Make sure to check HasNext first.

Reset

Resets internal pointer/counter.

public Action Reset

Field Value

Action

Shape

The shape this iterator iterates

public Shape Shape

Field Value

Shape

Type

public readonly IteratorType Type

Field Value

IteratorType

size

The size of this iterator.

public int size

Field Value

int

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<TOut> GetEnumerator()

Returns

IEnumerator<TOut>

An enumerator that can be used to iterate through the collection.

SetDefaults()

protected void SetDefaults()

SetMode(bool, Shape)

Set the mode according to given parameters

public void SetMode(bool autoreset, Shape reshape = default)

Parameters

autoreset bool

The iterator will transparently reset after it is done.

reshape Shape

Provide a different shape to the iterator.

autoresetDefault_Boolean()

protected void autoresetDefault_Boolean()

autoresetDefault_Byte()

protected void autoresetDefault_Byte()

autoresetDefault_Char()

protected void autoresetDefault_Char()

autoresetDefault_Decimal()

protected void autoresetDefault_Decimal()

autoresetDefault_Double()

protected void autoresetDefault_Double()

autoresetDefault_Int16()

protected void autoresetDefault_Int16()

autoresetDefault_Int32()

protected void autoresetDefault_Int32()

autoresetDefault_Int64()

protected void autoresetDefault_Int64()

autoresetDefault_NoCast()

protected void autoresetDefault_NoCast()

autoresetDefault_Single()

protected void autoresetDefault_Single()

autoresetDefault_UInt16()

protected void autoresetDefault_UInt16()

autoresetDefault_UInt32()

protected void autoresetDefault_UInt32()

autoresetDefault_UInt64()

protected void autoresetDefault_UInt64()

setDefaults_Boolean()

protected void setDefaults_Boolean()

setDefaults_Byte()

protected void setDefaults_Byte()

setDefaults_Char()

protected void setDefaults_Char()

setDefaults_Decimal()

protected void setDefaults_Decimal()

setDefaults_Double()

protected void setDefaults_Double()

setDefaults_Int16()

protected void setDefaults_Int16()

setDefaults_Int32()

protected void setDefaults_Int32()

setDefaults_Int64()

protected void setDefaults_Int64()

setDefaults_NoCast()

protected void setDefaults_NoCast()

setDefaults_Single()

protected void setDefaults_Single()

setDefaults_UInt16()

protected void setDefaults_UInt16()

setDefaults_UInt32()

protected void setDefaults_UInt32()

setDefaults_UInt64()

protected void setDefaults_UInt64()