Applies in parallel an accumulator function over a sequence. This overload is not available in the sequential implementation.
public:
generic <typename TSource, typename TAccumulate, typename TResult>
[System::Runtime::CompilerServices::Extension]
static TResult Aggregate(System::Linq::ParallelQuery<TSource> ^ source, Func<TAccumulate> ^ seedFactory, Func<TAccumulate, TSource, TAccumulate> ^ updateAccumulatorFunc, Func<TAccumulate, TAccumulate, TAccumulate> ^ combineAccumulatorsFunc, Func<TAccumulate, TResult> ^ resultSelector);
public static TResult Aggregate<TSource,TAccumulate,TResult>(this System.Linq.ParallelQuery<TSource> source, Func<TAccumulate> seedFactory, Func<TAccumulate,TSource,TAccumulate> updateAccumulatorFunc, Func<TAccumulate,TAccumulate,TAccumulate> combineAccumulatorsFunc, Func<TAccumulate,TResult> resultSelector);
static member Aggregate : System.Linq.ParallelQuery<'Source> * Func<'Accumulate> * Func<'Accumulate, 'Source, 'Accumulate> * Func<'Accumulate, 'Accumulate, 'Accumulate> * Func<'Accumulate, 'Result> -> 'Result
<Extension()>
Public Function Aggregate(Of TSource, TAccumulate, TResult) (source As ParallelQuery(Of TSource), seedFactory As Func(Of TAccumulate), updateAccumulatorFunc As Func(Of TAccumulate, TSource, TAccumulate), combineAccumulatorsFunc As Func(Of TAccumulate, TAccumulate, TAccumulate), resultSelector As Func(Of TAccumulate, TResult)) As TResult
Type Parameters
The type of the elements of source
.
The type of the accumulator value.
The type of the resulting value.
ParametersA function that returns the initial accumulator value.
An accumulator function to be invoked on each element in a partition.
An accumulator function to be invoked on the yielded accumulator result from each partition.
A function to transform the final accumulator value into the result value.
ReturnsTResult
The transformed final accumulator value.
Exceptionssource
or seedFactory
or updateAccumulatorFunc
or combineAccumulatorsFunc
or resultSelector
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
This overload is specific to parallelized queries. A parallelized query may partition the data source sequence into several sub-sequences (partitions). The updateAccumulatorFunc
is invoked on each element within partitions. Each partition then yields a single accumulated result. The combineAccumulatorsFunc
is then invoked on the results of each partition to yield a single element. This element is then transformed by the resultSelector
function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4