Aggregators.Create Method

Definition

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

Overload List

Create<T, TResult>(Func<Vector<T>, TResult>)

Constructs a new aggregator from a function.
C#
public static Aggregator<T, TResult> Create<T, TResult>(
	Func<Vector<T>, TResult> function
)

Parameters

function  Func<Vector<T>, TResult>
A function that computes the aggregated value of a vector.

Type Parameters

T
The type of the result.
TResult
The element type of the inputs.

Return Value

Aggregator<T, TResult>
An aggregator group.

Create<T, TResult, TAccumulator>(Func<TAccumulator, TResult>, AggregatorAttributes, TResult)

Constructs a new aggregator that uses the specified accumulator.
C#
public static Aggregator<T, TResult> Create<T, TResult, TAccumulator>(
	Func<TAccumulator, TResult> selector,
	AggregatorAttributes attributes,
	TResult emptyValue
)
where TAccumulator : struct, new(), IAccumulator<T>

Parameters

selector  Func<TAccumulator, TResult>
 
attributes  AggregatorAttributes
 
emptyValue  TResult
 

Type Parameters

T
The element type of the inputs to the accumulator.
TResult
The element type of the result.
TAccumulator
The type of the accumulator.

Return Value

Aggregator<T, TResult>
An aggregator that aggregates values of type T into values of type TResult using an accumulator of type TAccumulator.

Create<T, TResult, TIntermediate, TAccumulator>(Func<TAccumulator, TResult>, AggregatorAttributes, TResult)

C#
public static BinaryAggregator<T, T, TResult>? Create<T, TResult, TIntermediate, TAccumulator>(
	Func<TAccumulator, TResult> selector,
	AggregatorAttributes attributes,
	TResult emptyValue
)
where TAccumulator : struct, new(), IBinaryAccumulator<TIntermediate, TIntermediate>

Parameters

selector  Func<TAccumulator, TResult>
 
attributes  AggregatorAttributes
 
emptyValue  TResult
 

Type Parameters

T
TResult
TIntermediate
TAccumulator

Return Value

BinaryAggregator<T, T, TResult>

See Also