ListVector<T>.AggregateLists Method

Definition

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

Overload List

AggregateLists(TypePreservingAggregatorGroup, Vector<T>) Aggregates each list using the specified missing-element policy.
AggregateLists(TypePreservingAggregatorGroup, Boolean, Vector<T>) Aggregates each list using the specified missing-element policy.
AggregateLists<TResult>(Aggregator<T, TResult>, Vector<TResult>) Aggregates each list using the specified missing-element policy.
AggregateLists<TResult>(AggregatorGroup<TResult>, Vector<TResult>) Aggregates each list using the specified missing-element policy.
AggregateLists<TResult>(Aggregator<T, TResult>, Boolean, Vector<TResult>) Aggregates each list using the specified missing-element policy.
AggregateLists<TResult>(AggregatorGroup<TResult>, Boolean, Vector<TResult>) Aggregates each list using the specified missing-element policy.

AggregateLists<TResult>(Aggregator<T, TResult>, Vector<TResult>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<TResult> AggregateLists<TResult>(
	Aggregator<T, TResult> aggregator,
	Vector<TResult>? result = null
)

Parameters

aggregator  Aggregator<T, TResult>
The aggregator to apply to each list.
result  Vector<TResult>  (Optional)
Optional. The vector that is to hold the result. May be null.

Type Parameters

TResult
The type of the aggregation result.

Return Value

Vector<TResult>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are omitted when CheckForMissingValues is enabled on this vector. Use the overload with an explicit skipMissingValues argument to override the policy for one operation.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

AggregateLists<TResult>(AggregatorGroup<TResult>, Vector<TResult>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<TResult> AggregateLists<TResult>(
	AggregatorGroup<TResult> aggregator,
	Vector<TResult>? result = null
)

Parameters

aggregator  AggregatorGroup<TResult>
The aggregator to apply to each list.
result  Vector<TResult>  (Optional)
Optional. The vector that is to hold the result. May be null.

Type Parameters

TResult
The type of the aggregation result.

Return Value

Vector<TResult>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are omitted when CheckForMissingValues is enabled on this vector. Use the overload with an explicit skipMissingValues argument to override the policy for one operation.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

AggregateLists(TypePreservingAggregatorGroup, Vector<T>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<T> AggregateLists(
	TypePreservingAggregatorGroup aggregator,
	Vector<T>? result = null
)

Parameters

aggregator  TypePreservingAggregatorGroup
The aggregator to apply to each list.
result  Vector<T>  (Optional)
Optional. The vector that is to hold the result. May be null.

Return Value

Vector<T>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are omitted when CheckForMissingValues is enabled on this vector. Use the overload with an explicit skipMissingValues argument to override the policy for one operation.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

AggregateLists<TResult>(Aggregator<T, TResult>, Boolean, Vector<TResult>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<TResult> AggregateLists<TResult>(
	Aggregator<T, TResult> aggregator,
	bool skipMissingValues,
	Vector<TResult>? result = null
)

Parameters

aggregator  Aggregator<T, TResult>
The aggregator to apply to each list.
skipMissingValues  Boolean
Whether to omit missing elements, overriding the vector's missing-value policy for this operation.
result  Vector<TResult>  (Optional)
Optional. The vector that is to hold the result. May be null.

Type Parameters

TResult
The type of the aggregation result.

Return Value

Vector<TResult>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are identified by the element type's native missing representation. Missing elements within a list are distinct from missing whole lists. Empty lists and list boundaries are retained.

When omission leaves no observations, Count and Sum return zero; Mean is missing. A list containing a genuine zero has mean zero. GetListLengths() always reports stored element counts.

When skipMissingValues is false, stored missing elements are passed to the aggregator. Count includes them, and floating-point Sum/Mean can propagate NaNs.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

AggregateLists<TResult>(AggregatorGroup<TResult>, Boolean, Vector<TResult>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<TResult> AggregateLists<TResult>(
	AggregatorGroup<TResult> aggregator,
	bool skipMissingValues,
	Vector<TResult>? result = null
)

Parameters

aggregator  AggregatorGroup<TResult>
The aggregator to apply to each list.
skipMissingValues  Boolean
Whether to omit missing elements, overriding the vector's missing-value policy for this operation.
result  Vector<TResult>  (Optional)
Optional. The vector that is to hold the result. May be null.

Type Parameters

TResult
The type of the aggregation result.

Return Value

Vector<TResult>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are identified by the element type's native missing representation. Missing elements within a list are distinct from missing whole lists. Empty lists and list boundaries are retained.

When omission leaves no observations, Count and Sum return zero; Mean is missing. A list containing a genuine zero has mean zero. GetListLengths() always reports stored element counts.

When skipMissingValues is false, stored missing elements are passed to the aggregator. Count includes them, and floating-point Sum/Mean can propagate NaNs.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

AggregateLists(TypePreservingAggregatorGroup, Boolean, Vector<T>)

Aggregates each list using the specified missing-element policy.
C#
public Vector<T> AggregateLists(
	TypePreservingAggregatorGroup aggregator,
	bool skipMissingValues,
	Vector<T>? result = null
)

Parameters

aggregator  TypePreservingAggregatorGroup
The aggregator to apply to each list.
skipMissingValues  Boolean
Whether to omit missing elements, overriding the vector's missing-value policy for this operation.
result  Vector<T>  (Optional)
Optional. The vector that is to hold the result. May be null.

Return Value

Vector<T>
A vector with one result per list and the same index as this vector.

Remarks

Missing elements are identified by the element type's native missing representation. Missing elements within a list are distinct from missing whole lists. Empty lists and list boundaries are retained.

When omission leaves no observations, Count and Sum return zero; Mean is missing. A list containing a genuine zero has mean zero. GetListLengths() always reports stored element counts.

When skipMissingValues is false, stored missing elements are passed to the aggregator. Count includes them, and floating-point Sum/Mean can propagate NaNs.

Exceptions

ArgumentNullExceptionaggregator is null.
ArgumentExceptionresult does not have the same length as this vector.
ComponentReadOnlyException The supplied result cannot be written.

See Also