Memory2D<T> Constructor

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

Memory2D<T>(Int32, Int32, Boolean) Constructs a new array.
Memory2D<T>(Memory<T>, Int32, Int32) Constructs a new array.

Memory2D<T>(Int32, Int32, Boolean)

Constructs a new array.
C#
public Memory2D(
	int rowCount,
	int columnCount,
	bool initializeToZero
)

Parameters

rowCount  Int32
The number of rows.
columnCount  Int32
The number of columns.
initializeToZero  Boolean
Indicates whether the elements should be explicitly set to zero.

Remarks

Use this constructor to create an array that can hold the specified number of rows and columns of data. All values are stored contiguously in column-major order.

Memory2D<T>(Memory<T>, Int32, Int32)

Constructs a new array.
C#
public Memory2D(
	Memory<T> values,
	int leadingDimension,
	int offset = 0
)

Parameters

values  Memory<T>
The storage array.
leadingDimension  Int32
The number of elements between the start of successive columns.
offset  Int32  (Optional)
The position of the first stored element in the array.

Remarks

The values array is re-used. Modifying elements in the 2D array will modify the elements in the original array. Conversely, if elements in the original array that correspond to elements in the 2D array are modified, the elements of the 2D array are modified as well.

See Also