Example #1
0
 /// <summary>Applies a function to each element of the CloudFlow, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.</summary>
 /// <param name="folder">A function that updates the state with each element from the CloudFlow.</param>
 /// <param name="combiner">A function that combines partial states into a new state.</param>
 /// <param name="state">A function that produces the initial state.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The final result.</returns>
 public static Cloud <TAccumulate> Aggregate <TSource, TAccumulate>(this CloudFlow <TSource> stream, Func <TAccumulate> state, Func <TAccumulate, TSource, TAccumulate> folder, Func <TAccumulate, TAccumulate, TAccumulate> combiner)
 {
     return(CSharpProxy.Aggregate(stream, state, folder, combiner));
 }
Example #2
0
 /// <summary>Applies a function to each element of the stream, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.</summary>
 /// <param name="folder">A function that updates the state with each element from the stream.</param>
 /// <param name="state">The initial state.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The final result.</returns>
 public static TAccumulate Aggregate<TSource, TAccumulate>(this Stream<TSource> stream, TAccumulate state, Func<TAccumulate, TSource, TAccumulate> folder)
 {
     return CSharpProxy.Aggregate(stream, state, folder);
 }
Example #3
0
 /// <summary>Applies a function to each element of the parallel stream, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.</summary>
 /// <param name="state">A function that produces the initial state.</param>
 /// <param name="folder">A function that updates the state with each element from the parallel stream.</param>
 /// <param name="combiner">A function that combines partial states into a new state.</param>
 /// <param name="stream">The input parallel stream.</param>
 /// <returns>The final result.</returns>
 public static TAccumulate Aggregate <TSource, TAccumulate>(this ParStream <TSource> stream, Func <TAccumulate> state, Func <TAccumulate, TSource, TAccumulate> folder, Func <TAccumulate, TAccumulate, TAccumulate> combiner)
 {
     return(CSharpProxy.Aggregate(stream, state, folder, combiner));
 }