Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FloatAverageAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class FloatAverageAggregationOperator : InlinedAggregationOperator<float, Pair<double, long>, float>
7{
9 {
11
17
19 {
20 double num = 0.0;
21 long num2 = 0L;
23 float currentElement2 = 0f;
24 TKey currentKey = default(TKey);
25 if (source.MoveNext(ref currentElement2, ref currentKey))
26 {
27 int num3 = 0;
28 do
29 {
30 if ((num3++ & 0x3F) == 0)
31 {
33 }
34 num += (double)currentElement2;
35 num2 = checked(num2 + 1);
36 }
37 while (source.MoveNext(ref currentElement2, ref currentKey));
39 return true;
40 }
41 return false;
42 }
43
44 protected override void Dispose(bool disposing)
45 {
47 }
48 }
49
51 : base(child)
52 {
53 }
54
56 {
58 {
60 if (!enumerator.MoveNext())
61 {
63 return 0f;
64 }
65 Pair<double, long> current = enumerator.Current;
66 while (enumerator.MoveNext())
67 {
68 current.First += enumerator.Current.First;
69 current.Second += enumerator.Current.Second;
70 }
71 return (float)(current.First / (double)current.Second);
72 }
73 }
74
79}
FloatAverageAggregationOperatorEnumerator(QueryOperatorEnumerator< float, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override QueryOperatorEnumerator< Pair< double, long >, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< float, TKey > source, object sharedData, CancellationToken cancellationToken)
override float InternalAggregate(ref Exception singularExceptionToThrow)
static string NoElements
Definition SR.cs:16
Definition SR.cs:7