Matrix.CopyFrom Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0

Overload List

CopyFrom<T>(T[,], ArrayMutability) Creates a new DenseMatrix<T> by copying data from a rectangular array.
CopyFrom<T>(T[], Int32, Int32, MatrixElementOrder, ArrayMutability, Boolean) Creates a new DenseMatrix<T> by copying data from a one-dimensional array.

CopyFrom<T>(T[,], ArrayMutability)

Creates a new DenseMatrix<T> by copying data from a rectangular array.
C#
public static DenseMatrix<T> CopyFrom<T>(
	T[,] source,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

source  T[2]
A rectangular array containing the matrix values.
mutability  ArrayMutability  (Optional)
Specifies how the matrix's values may be changed. The default is mutable values.

Type Parameters

T
The element type of the matrix.

Return Value

DenseMatrix<T>
A new DenseMatrix<T> with copied data.

Exceptions

ArgumentNullExceptionsource is null.

CopyFrom<T>(T[], Int32, Int32, MatrixElementOrder, ArrayMutability, Boolean)

Creates a new DenseMatrix<T> by copying data from a one-dimensional array.
C#
public static DenseMatrix<T> CopyFrom<T>(
	T[] source,
	int rowCount,
	int columnCount,
	MatrixElementOrder elementOrder = MatrixElementOrder.ColumnMajor,
	ArrayMutability mutability = ArrayMutability.MutableValues,
	bool checkMissingValues = false
)

Parameters

source  T[]
A one-dimensional array containing the matrix values.
rowCount  Int32
The number of rows in the matrix.
columnCount  Int32
The number of columns in the matrix.
elementOrder  MatrixElementOrder  (Optional)
A MatrixElementOrder value that specifies the order in which the matrix elements are stored in source.
mutability  ArrayMutability  (Optional)
Specifies how the matrix's values may be changed. The default is mutable values.
checkMissingValues  Boolean  (Optional)
Optional. Specifies whether operations involving the matrix should check for the presence of missing values. The default is false.

Type Parameters

T
The element type of the matrix.

Return Value

DenseMatrix<T>
A new DenseMatrix<T> with copied data.

Exceptions

ArgumentNullExceptionsource is null.
ArgumentOutOfRangeExceptionrowCount or columnCount is less than zero.

See Also