Modifica

Condividi tramite


ArrayExtensions.AsMemory Method

Definition

Overloads

AsMemory<T>(T[,,])

Creates a new Memory<T> over an input 3D T array.

AsMemory<T>(T[,])

Creates a new Memory<T> over an input 2D T array.

AsMemory<T>(T[,,], Int32)

Creates a new instance of the Memory<T> struct wrapping a layer in a 3D array.

AsMemory<T>(T[,,])

Creates a new Memory<T> over an input 3D T array.

public static Memory<T> AsMemory<T> (this T[,,]? array);
static member AsMemory : 'T[,,] -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,,)) As Memory(Of T)

Type Parameters

T

The type of elements in the input 3D T array instance.

Parameters

array
T[,,]

The input 3D T array instance.

Returns

Memory<T>

A Memory<T> instance with the values of array.

Applies to

AsMemory<T>(T[,])

Creates a new Memory<T> over an input 2D T array.

public static Memory<T> AsMemory<T> (this T[,]? array);
static member AsMemory : 'T[,] -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,)) As Memory(Of T)

Type Parameters

T

The type of elements in the input 2D T array instance.

Parameters

array
T[,]

The input 2D T array instance.

Returns

Memory<T>

A Memory<T> instance with the values of array.

Applies to

AsMemory<T>(T[,,], Int32)

Creates a new instance of the Memory<T> struct wrapping a layer in a 3D array.

public static Memory<T> AsMemory<T> (this T[,,] array, int depth);
static member AsMemory : 'T[,,] * int -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,,), depth As Integer) As Memory(Of T)

Type Parameters

T

The type of elements in the input 3D T array instance.

Parameters

array
T[,,]

The given 3D array to wrap.

depth
Int32

The target layer to map within array.

Returns

Memory<T>

A Memory<T> instance wrapping the target layer within array.

Exceptions

Thrown when array doesn't match T.

Thrown when depth is invalid.

Applies to