Aggregator<T, TResult>.AggregateBy Method

Definition

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

Overload List

AggregateBy(Vector<T>, IGrouping, Vector<TResult>) Groups the elements of a vector according to the specified grouping.
AggregateBy(Vector<T>, ReadOnlySpan<Int32>, Nullable<Boolean>, Vector<TResult>) Aggregates the elements of a vector according to the specified level indexes.
AggregateBy<TPredicate>(Vector<T>, ReadOnlySpan<Int32>, TPredicate, Nullable<Boolean>, Vector<TResult>) Groups the elements of a vector according to the specified level indexes.

AggregateBy(Vector<T>, IGrouping, Vector<TResult>)

Groups the elements of a vector according to the specified grouping.
C#
public virtual Vector<TResult> AggregateBy(
	Vector<T> values,
	IGrouping grouping,
	Vector<TResult>? result
)

Parameters

values  Vector<T>
The vector to aggregate.
grouping  IGrouping
A grouping.
result  Vector<TResult>
Optional. The vector that is to hold the result. May be null.

Return Value

Vector<TResult>
A vector containing the aggregated values.

AggregateBy(Vector<T>, ReadOnlySpan<Int32>, Nullable<Boolean>, Vector<TResult>)

Aggregates the elements of a vector according to the specified level indexes.
C#
public virtual Vector<TResult> AggregateBy(
	Vector<T> values,
	ReadOnlySpan<int> levels,
	bool? skipMissingValues,
	Vector<TResult> result
)

Parameters

values  Vector<T>
The vector to aggregate.
levels  ReadOnlySpan<Int32>
An array of level indexes.
skipMissingValues  Nullable<Boolean>
Specifies whether missing values should be excluded from the aggregation. If null, then the value is inferred from values.
result  Vector<TResult>
The vector that is to hold the result. May be null.

Return Value

Vector<TResult>

AggregateBy<TPredicate>(Vector<T>, ReadOnlySpan<Int32>, TPredicate, Nullable<Boolean>, Vector<TResult>)

Groups the elements of a vector according to the specified level indexes.
C#
public virtual Vector<TResult> AggregateBy<TPredicate>(
	Vector<T> values,
	ReadOnlySpan<int> levels,
	TPredicate predicate,
	bool? skipMissingValues,
	Vector<TResult> result
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

values  Vector<T>
The vector to aggregate.
levels  ReadOnlySpan<Int32>
An array of level indexes.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
skipMissingValues  Nullable<Boolean>
Specifies whether missing values should be excluded from the aggregation. If null, then the value is inferred from values.
result  Vector<TResult>
The vector that is to hold the result. May be null.

Type Parameters

TPredicate
The type of predicate.

Return Value

Vector<TResult>

See Also