コード例 #1
0
            protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
            {
                DataT result = math.Zero();
                DataT z      = math.Zero();

                foreach (var v in sourceColumn.VisitRows(sourceIndices))
                {
                    if (math.Compare(v, z) >= 0)
                    {
                        result = math.Add(result, v);
                    }
                }
                return(result);
            }
コード例 #2
0
 protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
 {
     using (Profiling.GetMarker(Profiling.MarkerId.MergeSumPositive).Auto())
     {
         DataT result = math.Zero();
         DataT z      = math.Zero();
         foreach (var v in sourceColumn.VisitRows(sourceIndices))
         {
             if (math.Compare(v, z) >= 0)
             {
                 result = math.Add(result, v);
             }
         }
         return(result);
     }
 }
コード例 #3
0
            protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
            {
                DataT count = math.Make(sourceIndices.Count);
                DataT avg   = math.Zero();

                foreach (var v in sourceColumn.VisitRows(sourceIndices))
                {
                    avg = math.Add(avg, v);
                }
                avg = math.Div(avg, count);

                DataT dev = math.Zero();

                foreach (var v in sourceColumn.VisitRows(sourceIndices))
                {
                    dev = math.Add(dev, math.SubAbs(avg, v));
                }
                dev = math.Div(dev, count);
                return(dev);
            }
コード例 #4
0
            protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
            {
                DataT result = math.Zero();

                foreach (var v in sourceColumn.VisitRows(sourceIndices))
                {
                    result = math.Add(result, v);
                }
                result = math.Div(result, math.Make(sourceIndices.Count));
                return(result);
            }
コード例 #5
0
            protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
            {
                using (Profiling.GetMarker(Profiling.MarkerId.MergeDeviation).Auto())
                {
                    DataT count = math.Make(sourceIndices.indexCount);
                    DataT avg   = math.Zero();
                    foreach (var v in sourceColumn.VisitRows(sourceIndices))
                    {
                        avg = math.Add(avg, v);
                    }
                    avg = math.Div(avg, count);

                    DataT dev = math.Zero();
                    foreach (var v in sourceColumn.VisitRows(sourceIndices))
                    {
                        dev = math.Add(dev, math.SubAbs(avg, v));
                    }
                    dev = math.Div(dev, count);
                    return(dev);
                }
            }
コード例 #6
0
 protected override IComparable GroupTyped(ColumnTyped <DataT> sourceColumn, ArrayRange sourceIndices)
 {
     using (Profiling.GetMarker(Profiling.MarkerId.MergeAverage).Auto())
     {
         DataT result = math.Zero();
         foreach (var v in sourceColumn.VisitRows(sourceIndices))
         {
             result = math.Add(result, v);
         }
         result = math.Div(result, math.Make(sourceIndices.indexCount));
         return(result);
     }
 }