示例#1
0
 /// <summary>
 ///     Takes values from the sequence to fill the provided collection.
 /// </summary>
 public static void CopyInto <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     ICollection <TV> output)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().CopyInto(output);
示例#2
0
 public static TSource Aggregate <TSource, TK, TC, TE>(
     this OrderingPlan <TSource, TK, TC, TE> plan,
     Func <TSource, TSource, TSource> func)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TSource, TK>
 =>
 plan.ToEnumerable().Aggregate(func);
示例#3
0
 /// <summary>
 ///     Takes enough values from the sequence to fill the provided span.
 /// </summary>
 /// <remarks>
 ///     A copy of the enumerable is taken, which means that (beyond any
 ///     side-effects of consuming values from it) the original
 ///     enumerable is unchanged.
 /// </remarks>
 /// <returns>
 ///     Returns the span, maybe resized if there were not enough values
 ///     in the enumerable.
 /// </returns>
 public static Span <TV> TakeInto <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     Span <TV> output)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().TakeInto(output);
示例#4
0
 /// <summary>
 ///     The sum of a sequence, with a delegate returning a double
 ///     for each element of the sequence.
 /// </summary>
 public static double Sum <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     Func <TV, double> getValue)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().Sum(getValue);
示例#5
0
 /// <summary>
 ///     The single element of a sequence that satisfies a predicate.
 /// </summary>
 public static TV Single <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> ordering,
     Predicate <TV> predicate)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 ordering.ToEnumerable().Single(predicate);
示例#6
0
 Slice <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     int offset)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().Slice(offset);
示例#7
0
 /// <summary>
 ///     Create a dictionary containing all elements from the input
 ///     sequence.
 /// </summary>
 public static Dictionary <TDK, TDV> ToDictionary <TV, TK, TC, TE, TDK, TDV>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     Func <TV, TDK> keySelector,
     Func <TV, TDV> valueSelector)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().ToDictionary(keySelector, valueSelector);
示例#8
0
 public static TAccum Aggregate <TSource, TK, TC, TE, TAccum>(
     this OrderingPlan <TSource, TK, TC, TE> plan,
     TAccum seed,
     Func <TAccum, TSource, TAccum> func)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TSource, TK>
 =>
 plan.ToEnumerable().Aggregate(seed, func);
示例#9
0
 /// <summary>
 ///     Takes values from the sequence to fill the provided dictionary.
 /// </summary>
 public static void CopyInto <TV, TK, TC, TE, TDV, TDK>(
     this OrderingPlan <TV, TK, TC, TE> plan,
     IDictionary <TDK, TDV> output,
     Func <TV, TDK> keySelector,
     Func <TV, TDV> valueSelector)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().CopyInto(output, keySelector, valueSelector);
示例#10
0
 /// <summary>
 ///     Create a hash set containing all elements from the input
 ///     sequence.
 /// </summary>
 public static HashSet <TV> ToHashSet <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().ToHashSet();
示例#11
0
 /// <summary>
 ///     Create an array containing all elements from the input
 ///     sequence.
 /// </summary>
 public static TV[] ToArray <TV, TK, TC, TE>(
     this OrderingPlan <TV, TK, TC, TE> plan)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <TV, TK>
 =>
 plan.ToEnumerable().ToArray();
示例#12
0
 /// <summary> The sum of a sequence of double. </summary>
 public static double Sum <TK, TC, TE>(
     this OrderingPlan <double, TK, TC, TE> plan)
     where TC : IComparer <TK>
     where TE : struct, IKeyExtractor <double, TK>
 =>
 plan.ToEnumerable().Sum();