Matrix.Copy From Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Overload List
| Copy | Creates a new DenseMatrix<T> by copying data from a rectangular array. |
| Copy | 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.
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
| Argument | source is null. |
CopyFrom<T>(T[], Int32, Int32, MatrixElementOrder, ArrayMutability, Boolean)
Creates a new DenseMatrix<T> by copying data from a one-dimensional array.
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
| Argument | source is null. |
| Argument | rowCount or columnCount is less than zero. |