Vector.Copy From 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 elements from nested sequences. |
| Copy | Constructs a new list vector by copying elements from a flattened vector with a grouping. |
CopyFromAsLists<T>(IEnumerable<IEnumerable<T>>)
Constructs a new list vector by copying elements from nested sequences.
public static ListVector<T> CopyFromAsLists<T>(
IEnumerable<IEnumerable<T>> source
)
Parameters
- source IEnumerable<IEnumerable<T>>
- A sequence of sequences containing the elements of each list.
Type Parameters
- T
- The element type of the lists.
Return Value
ListVector<T>A ListVector<T> containing the specified lists.
Remarks
This method copies all elements from the nested sequences into a flattened array. The resulting vector has immutable structure but mutable values by default.
When the source is a vector of lists, its index and missing-value awareness policy are retained.
Exceptions
| Argument | source is null. |
CopyFromAsLists<T>(Vector<T>, IGrouping)
Constructs a new list vector by copying elements from a flattened vector with a grouping.
public static ListVector<T> CopyFromAsLists<T>(
Vector<T> flat,
IGrouping grouping
)
Parameters
- flat Vector<T>
- A vector containing all elements in flattened form.
- grouping IGrouping
- A grouping that defines how to partition the flattened vector into lists.
Type Parameters
- T
- The element type of the lists.
Return Value
ListVector<T>A ListVector<T> containing the specified lists.
Remarks
This method copies elements from the flattened vector according to the grouping. The grouping's indexes are used to select elements from the flat vector.
The result retains the flat vector's missing-value awareness policy and uses the grouping's keys as its list index.
Exceptions
| Argument | flat or grouping is null. |