ListVector<T>.ToRowMatrix Method

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.2.0

Overload List

ToRowMatrix() Creates a matrix with the vector as its only column..
ToRowMatrix(T) Converts the list vector to a matrix with lists in rows, padding or truncating as necessary.
ToRowMatrix(Int32, T) Converts the list vector to a matrix with lists in rows, padding or truncating as necessary.

ToRowMatrix(T)

Converts the list vector to a matrix with lists in rows, padding or truncating as necessary.
C#
public Matrix<T> ToRowMatrix(
	T paddingValue
)

Parameters

paddingValue  T
The value to use for padding short lists.

Return Value

Matrix<T>
A matrix where each row corresponds to a list.

Remarks

Lists shorter than the maximum list length are padded with paddingValue. Lists longer than the maximum are truncated. The resulting matrix has as many rows as there are lists, and as many columns as the length of the longest list.

This method is useful for preparing variable-length data for algorithms that require rectangular input.

ToRowMatrix(Int32, T)

Converts the list vector to a matrix with lists in rows, padding or truncating as necessary.
C#
public Matrix<T> ToRowMatrix(
	int columnCount,
	T paddingValue
)

Parameters

columnCount  Int32
The number of columns in the resulting matrix.
paddingValue  T
The value to use for padding short lists.

Return Value

Matrix<T>
A matrix where each row corresponds to a list.

Remarks

Lists shorter than columnCount are padded with paddingValue. Lists longer than columnCount are truncated to the specified length.

See Also