Grouping<TKey>.AggregateInto Method

Definition

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

Overload List

AggregateInto<T, TResult>(Aggregator<T, TResult>, ReadOnlySpan<T>, Span<TResult>) Aggregates values over each group and writes the results into a span.
AggregateInto<T, TResult>(Vector<T>, Aggregator<T, TResult>, Vector<TResult>) Aggregates the specified vector over each group and returns the result.
AggregateInto<T1, T2, TResult>(Vector<T1>, Vector<T2>, BinaryAggregator<T1, T2, TResult>, Vector<TResult>) Aggregates the specified vector over each group and returns the result.
AggregateInto<T, TResult, TPredicate>(Aggregator<T, TResult>, ReadOnlySpanSlice<T>, TPredicate, Boolean, SpanSlice<TResult>) Aggregates the specified vector over each group and returns the result.
AggregateInto<T, TResult, TPredicate>(Vector<T>, Aggregator<T, TResult>, TPredicate, Nullable<Boolean>, Vector<TResult>) Aggregates the specified vector over each group and returns the result.

AggregateInto<T, TResult>(Aggregator<T, TResult>, ReadOnlySpan<T>, Span<TResult>)

Aggregates values over each group and writes the results into a span.
C#
public void AggregateInto<T, TResult>(
	Aggregator<T, TResult> aggregator,
	ReadOnlySpan<T> values,
	Span<TResult> result
)

Parameters

aggregator  Aggregator<T, TResult>
The aggregator to apply to each group.
values  ReadOnlySpan<T>
A contiguous read-only span of values to aggregate.
result  Span<TResult>
A span that will receive one aggregated value per group.

Type Parameters

T
The element type of the input values.
TResult
The type of the result of the aggregation.

Implements

IGrouping.AggregateInto<T, TResult>(Aggregator<T, TResult>, ReadOnlySpan<T>, Span<TResult>)

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

Aggregates the specified vector over each group and returns the result.
C#
public Vector<TResult> AggregateInto<T, TResult>(
	Vector<T> values,
	Aggregator<T, TResult> aggregator,
	Vector<TResult>? result
)

Parameters

values  Vector<T>
A vector.
aggregator  Aggregator<T, TResult>
The aggregator to apply to each group.
result  Vector<TResult>
The vector that is to hold the result of the aggregation. May be null.

Type Parameters

T
The element type of the input vector.
TResult
The type of the result of the aggregation.

Return Value

Vector<TResult>

Implements

IGrouping.AggregateInto<T, TResult>(Vector<T>, Aggregator<T, TResult>, Vector<TResult>)

Exceptions

ArgumentNullException

values is null.

-or-

aggregator is null.

DimensionMismatchException

The length of result is less than the number of groups.

AggregateInto<T1, T2, TResult>(Vector<T1>, Vector<T2>, BinaryAggregator<T1, T2, TResult>, Vector<TResult>)

Aggregates the specified vector over each group and returns the result.
C#
public virtual Vector<TResult> AggregateInto<T1, T2, TResult>(
	Vector<T1> values1,
	Vector<T2> values2,
	BinaryAggregator<T1, T2, TResult> aggregator,
	Vector<TResult>? result
)

Parameters

values1  Vector<T1>
A vector of values.
values2  Vector<T2>
A vector of values.
aggregator  BinaryAggregator<T1, T2, TResult>
The aggregator to apply to each group.
result  Vector<TResult>
The vector that is to hold the result of the aggregation. May be null.

Type Parameters

T1
The element type of the input vector.
T2
The element type of the second vector.
TResult
The type of the result of the aggregation.

Return Value

Vector<TResult>

Implements

IGrouping.AggregateInto<T1, T2, TResult>(Vector<T1>, Vector<T2>, BinaryAggregator<T1, T2, TResult>, Vector<TResult>)

Exceptions

ArgumentNullException

values1 is null.

-or-

values2 is null.

-or-

aggregator is null.

DimensionMismatchException

The length of result is less than the number of groups.

AggregateInto<T, TResult, TPredicate>(Aggregator<T, TResult>, ReadOnlySpanSlice<T>, TPredicate, Boolean, SpanSlice<TResult>)

Aggregates the specified vector over each group and returns the result.
C#
public virtual void AggregateInto<T, TResult, TPredicate>(
	Aggregator<T, TResult> aggregator,
	ReadOnlySpanSlice<T> values,
	TPredicate predicate,
	bool skipMissingValues,
	SpanSlice<TResult> result
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

aggregator  Aggregator<T, TResult>
The aggregator to apply to each group.
values  ReadOnlySpanSlice<T>
A span slice that contains the values to aggregate.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
skipMissingValues  Boolean
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.
result  SpanSlice<TResult>
The vector that is to hold the result.

Type Parameters

T
The element type of the input vector.
TResult
The type of the result of the aggregation.
TPredicate

Implements

IGrouping.AggregateInto<T, TResult, TPredicate>(Aggregator<T, TResult>, ReadOnlySpanSlice<T>, TPredicate, Boolean, SpanSlice<TResult>)

AggregateInto<T, TResult, TPredicate>(Vector<T>, Aggregator<T, TResult>, TPredicate, Nullable<Boolean>, Vector<TResult>)

Aggregates the specified vector over each group and returns the result.
C#
public virtual Vector<TResult> AggregateInto<T, TResult, TPredicate>(
	Vector<T> values,
	Aggregator<T, TResult> aggregator,
	TPredicate predicate,
	bool? skipMissingValues,
	Vector<TResult>? result
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

values  Vector<T>
A vector.
aggregator  Aggregator<T, TResult>
The aggregator to apply to each group.
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 of the aggregation. May be null.

Type Parameters

T
The element type of the input vector.
TResult
The type of the result of the aggregation.
TPredicate
The type of predicate.

Return Value

Vector<TResult>

Implements

IGrouping.AggregateInto<T, TResult, TPredicate>(Vector<T>, Aggregator<T, TResult>, TPredicate, Nullable<Boolean>, Vector<TResult>)

Exceptions

ArgumentNullException

values is null.

-or-

aggregator is null.

DimensionMismatchException

The length of result is less than the number of groups.

See Also