Vector.Copy From Rows As Lists Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
Overload List
| Copy | Constructs a new list vector by copying rows from a matrix. |
| Copy | Constructs a new list vector by copying rows from a matrix, trimming trailing padding values. |
CopyFromRowsAsLists<T>(Matrix<T>)
Constructs a new list vector by copying rows from a matrix.
public static ListVector<T> CopyFromRowsAsLists<T>(
Matrix<T> matrix
)
Parameters
- matrix Matrix<T>
- A matrix whose rows will become lists.
Type Parameters
- T
- The element type of the matrix.
Return Value
ListVector<T>A ListVector<T> where each list corresponds to a matrix row.
Remarks
This method copies all elements from the matrix rows into lists. All lists will have the same length (number of columns in the matrix).
The result retains the matrix's missing-value awareness policy and row index.
Exceptions
| Argument | matrix is null. |
CopyFromRowsAsLists<T>(Matrix<T>, T)
Constructs a new list vector by copying rows from a matrix, trimming trailing padding values.
public static ListVector<T> CopyFromRowsAsLists<T>(
Matrix<T> matrix,
T paddingValue
)
Parameters
- matrix Matrix<T>
- A matrix whose rows will become lists.
- paddingValue T
- The value to treat as padding and trim from the end of each row.
Type Parameters
- T
- The element type of the matrix.
Return Value
ListVector<T>A ListVector<T> where each list corresponds to a matrix row with padding removed.
Remarks
This method copies rows from the matrix but removes trailing elements that equal paddingValue. This is useful for converting padded matrices back to variable-length lists.
Exceptions
| Argument | matrix is null. |