Table of Contents

Interface IArraySlice

Namespace
NumSharp.Backends.Unmanaged
Assembly
NumSharp.dll
public interface IArraySlice : IMemoryBlock, ICloneable, IEnumerable
Inherited Members
Extension Methods

Properties

this[int]

object this[int index] { get; set; }

Parameters

index int

Property Value

object

MemoryBlock

IMemoryBlock MemoryBlock { get; }

Property Value

IMemoryBlock

Methods

AsSpan<T>()

Span<T> AsSpan<T>()

Returns

Span<T>

Type Parameters

T

Remarks

Does not perform copy.

Clone()

IArraySlice Clone()

Returns

IArraySlice

Clone<T>()

ArraySlice<T> Clone<T>() where T : unmanaged

Returns

ArraySlice<T>

Type Parameters

T

CopyTo<T>(Span<T>)

void CopyTo<T>(Span<T> destination)

Parameters

destination Span<T>

Type Parameters

T

DangerousFree()

Performs dispose on the internal unmanaged memory block.

void DangerousFree()

Remarks

Dangerous because this ArraySlice might be a IsSlice therefore there might be other slices that point to current MemoryBlock.
So releasing the MemoryBlock might cause memory corruption elsewhere.
It is best to leave MemoryBlock to GC.

Fill(object)

Fills all indexes with value.

void Fill(object value)

Parameters

value object

GetIndex(int)

object GetIndex(int index)

Parameters

index int

Returns

object

GetIndex<T>(int)

T GetIndex<T>(int index) where T : unmanaged

Parameters

index int

Returns

T

Type Parameters

T

GetPinnableReference<T>()

Gets pinnable reference of the first item in the memory block storage.

ref T GetPinnableReference<T>() where T : unmanaged

Returns

T

Type Parameters

T

SetIndex(int, object)

void SetIndex(int index, object value)

Parameters

index int
value object

SetIndex<T>(int, T)

void SetIndex<T>(int index, T value) where T : unmanaged

Parameters

index int
value T

Type Parameters

T

Slice(int)

Perform a slicing on this IMemoryBlock without copying data.

IArraySlice Slice(int start)

Parameters

start int

The index to start from

Returns

IArraySlice

Remarks

Creates a slice without copying.

Slice(int, int)

Perform a slicing on this IMemoryBlock without copying data.

IArraySlice Slice(int start, int count)

Parameters

start int

The index to start from

count int

The number of items to slice (not bytes)

Returns

IArraySlice

Remarks

Creates a slice without copying.

ToArray()

Copies this IArraySlice contents into a new array.

Array ToArray()

Returns

Array