Пример #1
0
        //===========================================WORK IN PROGRESS REGION=======================================================

        #region WorkInProgress

        public DataFrame <TRowKey, TColumnKey> GetAddressRange(IRangeBoundary <long> range)
        {
            var seqConstrCmd = _indexBuilder.GetAddressRange(new SequenceConstruction <TRowKey>(_rowIndex, new Return(0)), range);
            var newData      = _data.Select <IVector>(
                vec =>
            {
                //_vectorBuilder.Build(seqConstrCmd.VectorConstruction, new IVector[] { Vector.TransformColumn<IVector>(vec, _vectorBuilder) });
                //var newVec = Vector.unboxVector<IVector>
                var res = Vector.TransformColumn(vec, _vectorBuilder, seqConstrCmd.VectorConstruction);
                //var res =_vectorBuilder.Build<IVector>(seqConstrCmd.VectorConstruction, new IVector[] { vec });
                return(res);
            });

            return(new DataFrame <TRowKey, TColumnKey>(seqConstrCmd.Index, _columnIndex, newData, _indexBuilder, _vectorBuilder));
        }
Пример #2
0
        public SequenceConstruction <KeyT> GetRange <KeyT>(SequenceConstruction <KeyT> sequenceConstruction, IRangeBoundary <KeyT> range)
        {
            long minAddr = 0L;
            long maxAddr = (sequenceConstruction.Index.KeyCount - 1);

            long loBound = 0;
            long hiBound = 0;

            if (range.GetType() == typeof(IntervalOf <KeyT>))
            {
                var newRange = (IntervalOf <KeyT>)range;
                //TODO support other lookup semantics
                //TODO add error handling missing keys here
                loBound = sequenceConstruction.Index.Lookup(newRange.Start, LookupSemantics.Exact).Value;
                hiBound = sequenceConstruction.Index.Lookup(newRange.End, LookupSemantics.Exact).Value;
            }

            //TODO add checks for missing keys
            if (hiBound > loBound)
            {
                var newIndex = new LinearRangeIndex <KeyT>(sequenceConstruction.Index, loBound, hiBound);
                IVecConstructionCmd newVectorContr = new GetRange(sequenceConstruction.VectorConstruction, new IntervalOf <Int64>(hiBound, loBound, BoundaryBehavior.Inclusive));
                return(new SequenceConstruction <KeyT>(newIndex, newVectorContr));
            }
            else
            {
                //TODO reversed range handling
            }

            //TODO
            return(null);
        }
Пример #3
0
 public SequenceConstruction <KeyT> GetAddressRange <KeyT>(SequenceConstruction <KeyT> indexConstruction, IRangeBoundary <long> range)
 {
     //TODO come up with better type conversions here
     if (range.GetType() == typeof(IntervalOf <long>))
     {
         var newRange        = (IntervalOf <long>)range;
         var newVectorConstr = new GetRange(indexConstruction.VectorConstruction, new IntervalOf <long>(newRange.Start, newRange.End, BoundaryBehavior.Inclusive));
         var newIndex        = new LinearRangeIndex <KeyT>(indexConstruction.Index, newRange.Start, newRange.End);
         return(new SequenceConstruction <KeyT>(newIndex, newVectorConstr));
     }
     return(null);
 }
Пример #4
0
 public GetRange(IVecConstructionCmd vecConstructionCmd, IRangeBoundary <Int64> rangeBoundary)
 {
     //TODO add error handling here
     VecConstructionCmd = vecConstructionCmd;
     RangeBoundary      = rangeBoundary;
 }