Matrix.From Columns 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
| From | Constructs a new matrix from the specified vectors. |
| From | Creates a new matrix from an enumerable collection of column arrays. |
FromColumns<T>(Vector<T>[])
Constructs a new matrix from the specified vectors.
public static Matrix<T> FromColumns<T>(
params Vector<T>[] columns
)
Parameters
- columns Vector<T>[]
- A parameter array of vectors of T.
Type Parameters
- T
- The element type of the matrix.
Return Value
Matrix<T>A matrix constructed by joining the vectors in columns.
Remarks
All vectors must have the same length.
Exceptions
| Argument | columns is null. |
| Argument | One of the elements of columns is null. |
| Dimension | Not all of the vectors in columns have the same length. |
FromColumns<T>(IEnumerable<T[]>, ArrayMutability, Boolean)
Creates a new matrix from an enumerable collection of column arrays.
public static DenseMatrix<T> FromColumns<T>(
IEnumerable<T[]> columns,
ArrayMutability mutability = ArrayMutability.MutableValues,
bool checkMissingValues = false
)
Parameters
- columns IEnumerable<T[]>
- An enumerable collection of arrays representing the columns of the matrix.
- 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> constructed from the columns.
Exceptions
| Argument | columns is null. |
| Argument | One or more elements of columns is null, or the columns have different lengths. |