Table of Contents

Struct NDArray._Unsafe

Namespace
NumSharp
Assembly
NumSharp.dll
public readonly struct NDArray._Unsafe
Inherited Members
Extension Methods

Properties

Address

Returns the memory address to the start of this block of memory.

public void* Address { get; }

Property Value

void*

Exceptions

InvalidOperationException

When this NDArray is a slice.

BytesLength

How many bytes are stored in this memory block.

public int BytesLength { get; }

Property Value

int

Remarks

Calculated by Count*ItemLength

Count

How many items are stored in Address.

public int Count { get; }

Property Value

int

Remarks

Not to confuse with BytesLength

ItemLength

The size of a single item stored in Address.

public int ItemLength { get; }

Property Value

int

Remarks

Equivalent to NPTypeCode.SizeOf extension.

Pin

Provides the ability to return a pin to the memory address of NDArray.

public NDArray._Unsafe._Pinning Pin { get; }

Property Value

NDArray._Unsafe._Pinning

Remarks

Possible only when the ndarray is not sliced.

Storage

Provides access to the internal UnmanagedStorage.

public UnmanagedStorage Storage { get; }

Property Value

UnmanagedStorage

Methods

AsSpan<T>()

public Span<T> AsSpan<T>()

Returns

Span<T>

Type Parameters

T

Remarks

Does not perform copy.

Fill(object)

Fills all indexes with value.

public void Fill(object value)

Parameters

value object

GetIndex(int)

public object GetIndex(int index)

Parameters

index int

Returns

object

GetIndex<T>(int)

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

Parameters

index int

Returns

T

Type Parameters

T

GetPinnableReference()

public ref byte GetPinnableReference()

Returns

byte

Exceptions

InvalidOperationException

When this NDArray is a slice.

GetPinnableReference<T>()

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

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

Returns

T

Type Parameters

T