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
Remarks
Calculated by Count*ItemLength
Count
How many items are stored in Address.
public int Count { get; }
Property Value
Remarks
Not to confuse with BytesLength
ItemLength
The size of a single item stored in Address.
public int ItemLength { get; }
Property Value
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
Remarks
Possible only when the ndarray is not sliced.
Storage
Provides access to the internal UnmanagedStorage.
public UnmanagedStorage Storage { get; }
Property Value
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
valueobject
GetIndex(int)
public object GetIndex(int index)
Parameters
indexint
Returns
GetIndex<T>(int)
public T GetIndex<T>(int index) where T : unmanaged
Parameters
indexint
Returns
- T
Type Parameters
T
GetPinnableReference()
public ref byte GetPinnableReference()
Returns
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