Vector.Copy From Columns 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 columns from a matrix. |
| Copy | Constructs a new list vector by copying columns from a matrix, trimming trailing padding values. |
CopyFromColumnsAsLists<T>(Matrix<T>)
Constructs a new list vector by copying columns from a matrix.
public static ListVector<T> CopyFromColumnsAsLists<T>(
Matrix<T> matrix
)
Parameters
- matrix Matrix<T>
- A matrix whose columns 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 column.
Remarks
This method copies all elements from the matrix columns into lists. All lists will have the same length (number of rows in the matrix).
The result retains the matrix's missing-value awareness policy and column index.
Exceptions
| Argument | matrix is null. |
CopyFromColumnsAsLists<T>(Matrix<T>, T)
Constructs a new list vector by copying columns from a matrix, trimming trailing padding values.
public static ListVector<T> CopyFromColumnsAsLists<T>(
Matrix<T> matrix,
T paddingValue
)
Parameters
- matrix Matrix<T>
- A matrix whose columns will become lists.
- paddingValue T
- The value to treat as padding and trim from the end of each column.
Type Parameters
- T
- The element type of the matrix.
Return Value
ListVector<T>A ListVector<T> where each list corresponds to a matrix column with padding removed.
Remarks
This method copies columns from the matrix but removes trailing elements that equal paddingValue. This is useful for converting padded matrices back to variable-length lists.
The result retains the matrix's missing-value awareness policy and column index.
Exceptions
| Argument | matrix is null. |