Matrix.FromColumns Method

Definition

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

Overload List

FromColumns<T>(Vector<T>[]) Constructs a new matrix from the specified vectors.
FromColumns<T>(IEnumerable<T[]>, ArrayMutability, Boolean) Creates a new matrix from an enumerable collection of column arrays.

FromColumns<T>(Vector<T>[])

Constructs a new matrix from the specified vectors.
C#
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

ArgumentNullException

columns is null.

ArgumentException

One of the elements of columns is null.

DimensionMismatchException

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.
C#
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

ArgumentNullExceptioncolumns is null.
ArgumentException One or more elements of columns is null, or the columns have different lengths.

See Also