Matrix.FromRows Method

Definition

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

Overload List

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

FromRows<T>(ReadOnlySpan<Vector<T>>)

Constructs a new matrix from the specified vectors.
C#
public static Matrix<T> FromRows<T>(
	ReadOnlySpan<Vector<T>> rows
)

Parameters

rows  ReadOnlySpan<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 rows.

Remarks

All vectors must have the same length.

Exceptions

ArgumentNullException

rows is null.

ArgumentException

One of the elements of rows is null.

DimensionMismatchException

Not all of the vectors in rows have the same length.

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

Constructs a new matrix from the specified vectors.
C#
public static Matrix<T> FromRows<T>(
	params Vector<T>[] rows
)

Parameters

rows  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 rows.

Remarks

All vectors must have the same length.

Exceptions

ArgumentNullException

rows is null.

ArgumentException

One of the elements of rows is null.

DimensionMismatchException

Not all of the vectors in rows have the same length.

FromRows<T>(IEnumerable<T[]>, ArrayMutability, Boolean)

Creates a new matrix from an enumerable collection of row arrays.
C#
public static DenseMatrix<T> FromRows<T>(
	IEnumerable<T[]> rows,
	ArrayMutability mutability = ArrayMutability.MutableValues,
	bool checkMissingValues = false
)

Parameters

rows  IEnumerable<T[]>
An enumerable collection of arrays representing the rows 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 rows.

Exceptions

ArgumentNullExceptionrows is null.
ArgumentException One or more elements of rows is null, or the rows have different lengths.

See Also