public void Min(PrimitiveColumnContainer <DateTime> column, IEnumerable <long> rows, out DateTime ret)
        {
            ret = default;
            var  readOnlySpan             = column.Buffers[0].ReadOnlySpan;
            long minRange                 = 0;
            long maxRange                 = ReadOnlyDataFrameBuffer <DateTime> .MaxCapacity;
            long maxCapacity              = maxRange;
            IEnumerator <long> enumerator = rows.GetEnumerator();

            while (enumerator.MoveNext())
            {
                long row = enumerator.Current;
                if (row < minRange || row >= maxRange)
                {
                    int bufferIndex = (int)(row / maxCapacity);
                    readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan;
                    minRange     = checked (bufferIndex * maxCapacity);
                    maxRange     = checked ((bufferIndex + 1) * maxCapacity);
                }
                row -= minRange;

                var val = readOnlySpan[(int)row];

                if (val < ret)
                {
                    ret = val;
                }
            }
        }
        public void CumulativeMax(PrimitiveColumnContainer <DateTime> column)
        {
            var ret = column.Buffers[0].ReadOnlySpan[0];

            for (int b = 0; b < column.Buffers.Count; b++)
            {
                var buffer        = column.Buffers[b];
                var mutableBuffer = DataFrameBuffer <DateTime> .GetMutableBuffer(buffer);

                var mutableSpan  = mutableBuffer.Span;
                var readOnlySpan = buffer.ReadOnlySpan;
                for (int i = 0; i < readOnlySpan.Length; i++)
                {
                    var val = readOnlySpan[i];

                    if (val > ret)
                    {
                        ret = val;
                    }

                    mutableSpan[i] = ret;
                }
                column.Buffers[b] = mutableBuffer;
            }
        }
        public void CumulativeMax(PrimitiveColumnContainer <DateTime> column, IEnumerable <long> rows)
        {
            var ret           = default(DateTime);
            var mutableBuffer = DataFrameBuffer <DateTime> .GetMutableBuffer(column.Buffers[0]);

            var  span        = mutableBuffer.Span;
            long minRange    = 0;
            long maxRange    = ReadOnlyDataFrameBuffer <DateTime> .MaxCapacity;
            long maxCapacity = maxRange;
            IEnumerator <long> enumerator = rows.GetEnumerator();

            if (enumerator.MoveNext())
            {
                long row = enumerator.Current;
                if (row < minRange || row >= maxRange)
                {
                    int bufferIndex = (int)(row / maxCapacity);
                    mutableBuffer = DataFrameBuffer <DateTime> .GetMutableBuffer(column.Buffers[bufferIndex]);

                    span     = mutableBuffer.Span;
                    minRange = checked (bufferIndex * maxCapacity);
                    maxRange = checked ((bufferIndex + 1) * maxCapacity);
                }
                row -= minRange;
                ret  = span[(int)row];
            }

            while (enumerator.MoveNext())
            {
                long row = enumerator.Current;
                if (row < minRange || row >= maxRange)
                {
                    int bufferIndex = (int)(row / maxCapacity);
                    mutableBuffer = DataFrameBuffer <DateTime> .GetMutableBuffer(column.Buffers[bufferIndex]);

                    span     = mutableBuffer.Span;
                    minRange = checked (bufferIndex * maxCapacity);
                    maxRange = checked ((bufferIndex + 1) * maxCapacity);
                }
                row -= minRange;

                var val = span[(int)row];

                if (val > ret)
                {
                    ret = val;
                }

                span[(int)row] = ret;
            }
        }
        public void Min(PrimitiveColumnContainer <DateTime> column, out DateTime ret)
        {
            ret = column.Buffers[0].ReadOnlySpan[0];
            for (int b = 0; b < column.Buffers.Count; b++)
            {
                var buffer       = column.Buffers[b];
                var readOnlySpan = buffer.ReadOnlySpan;
                for (int i = 0; i < readOnlySpan.Length; i++)
                {
                    var val = readOnlySpan[i];

                    if (val < ret)
                    {
                        ret = val;
                    }
                }
            }
        }
Пример #5
0
 internal Int64DataFrameColumn(string name, PrimitiveColumnContainer <long> values) : base(name, values)
 {
 }
Пример #6
0
 internal Int32DataFrameColumn(string name, PrimitiveColumnContainer <int> values) : base(name, values)
 {
 }
Пример #7
0
 internal ByteDataFrameColumn(string name, PrimitiveColumnContainer <byte> values) : base(name, values)
 {
 }
 public void CumulativeSum(PrimitiveColumnContainer <DateTime> column)
 {
     throw new NotSupportedException();
 }
 public PrimitiveDataFrameColumn(string name, long length = 0) : base(name, length, typeof(T))
 {
     _columnContainer = new PrimitiveColumnContainer <T>(length);
 }
 internal PrimitiveDataFrameColumn(string name, PrimitiveColumnContainer <T> column) : base(name, column.Length, typeof(T))
 {
     _columnContainer = column;
 }
Пример #11
0
 internal CharDataFrameColumn(string name, PrimitiveColumnContainer <char> values) : base(name, values)
 {
 }
 public void Sum(PrimitiveColumnContainer <DateTime> column, IEnumerable <long> rows, out DateTime ret)
 {
     throw new NotSupportedException();
 }
 public void Product(PrimitiveColumnContainer <DateTime> column, out DateTime ret)
 {
     throw new NotSupportedException();
 }
 public void Any(PrimitiveColumnContainer <DateTime> column, out bool ret)
 {
     throw new NotSupportedException();
 }
Пример #15
0
 internal SingleDataFrameColumn(string name, PrimitiveColumnContainer <float> values) : base(name, values)
 {
 }
Пример #16
0
 internal UInt16DataFrameColumn(string name, PrimitiveColumnContainer <ushort> values) : base(name, values)
 {
 }
 public void Round(PrimitiveColumnContainer <DateTime> column)
 {
     throw new NotSupportedException();
 }
Пример #18
0
 internal DoubleDataFrameColumn(string name, PrimitiveColumnContainer <double> values) : base(name, values)
 {
 }
Пример #19
0
 internal BooleanDataFrameColumn(string name, PrimitiveColumnContainer <bool> values) : base(name, values)
 {
 }
 public PrimitiveDataFrameColumn(string name, IEnumerable <T> values) : base(name, 0, typeof(T))
 {
     _columnContainer = new PrimitiveColumnContainer <T>(values);
     Length           = _columnContainer.Length;
 }
 internal DecimalDataFrameColumn(string name, PrimitiveColumnContainer <decimal> values) : base(name, values)
 {
 }
 public PrimitiveDataFrameColumn(string name, ReadOnlyMemory <byte> buffer, ReadOnlyMemory <byte> nullBitMap, int length = 0, int nullCount = 0) : base(name, length, typeof(T))
 {
     _columnContainer = new PrimitiveColumnContainer <T>(buffer, nullBitMap, length, nullCount);
 }
 public void CumulativeProduct(PrimitiveColumnContainer <DateTime> column, IEnumerable <long> rows)
 {
     throw new NotSupportedException();
 }