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
-
IEnumerable<TOut>
- Inherited Members
- Extension Methods
Constructors
NDIterator(IArraySlice, Shape, Shape?, bool)
public NDIterator(IArraySlice slice, Shape shape, Shape? broadcastedShape, bool autoReset = false)
Parameters
sliceIArraySliceshapeShapebroadcastedShapeShape?autoResetbool
NDIterator(IMemoryBlock, Shape, Shape?, bool)
public NDIterator(IMemoryBlock block, Shape shape, Shape? broadcastedShape, bool autoReset = false)
Parameters
blockIMemoryBlockshapeShapebroadcastedShapeShape?autoResetbool
NDIterator(UnmanagedStorage, bool)
public NDIterator(UnmanagedStorage storage, bool autoReset = false)
Parameters
storageUnmanagedStorageautoResetbool
NDIterator(NDArray, bool)
public NDIterator(NDArray arr, bool autoReset = false)
Parameters
Fields
AutoReset
Does this iterator resets automatically when it finishes?
public bool AutoReset
Field Value
Remarks
When this is true, HasNext always returns true.
Block
public readonly IMemoryBlock Block
Field Value
BroadcastedShape
The broadcasted version of Shape.
public Shape? BroadcastedShape
Field Value
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
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
Remarks
Make sure to check HasNext first.
Reset
Resets internal pointer/counter.
public Action Reset
Field Value
Shape
The shape this iterator iterates
public Shape Shape
Field Value
Type
public readonly IteratorType Type
Field Value
size
The size of this iterator.
public int size
Field Value
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
autoresetboolThe iterator will transparently reset after it is done.
reshapeShapeProvide 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()