示例#1
0
        Tuple <IIndex <a>, VectorConstruction> IIndexBuilder.GetAddressRange <a>(Tuple <IIndex <a>, VectorConstruction> _arg11, RangeRestriction <long> range)
        {
            Tuple <IIndex <a>, VectorConstruction> tuple = _arg11;
            VectorConstruction vectorConstruction1       = tuple.Item2;
            IIndex <a>         index1  = tuple.Item1;
            IIndexBuilder      builder = (IIndexBuilder)this;
            FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > fsharpChoice = range.AsAbsolute(index1.KeyCount);

            if (fsharpChoice is FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)
            {
                FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2 choice1Of2 = (FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)fsharpChoice;
                long num1 = choice1Of2.get_Item().Item1;
                if (choice1Of2.get_Item().Item2 < num1)
                {
                    long num2 = choice1Of2.get_Item().Item1;
                    long num3 = choice1Of2.get_Item().Item2;
                    return(new Tuple <IIndex <a>, VectorConstruction>((IIndex <a>) new LinearIndex <a>(ReadOnlyCollection.empty <a>(), builder, FSharpOption <bool> .Some(true)), VectorConstruction.NewEmpty(0L)));
                }
            }
            if (!(fsharpChoice is FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice2Of2))
            {
                FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2 choice1Of2 = (FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)fsharpChoice;
                long startAddress         = choice1Of2.get_Item().Item1;
                long endAddress           = choice1Of2.get_Item().Item2;
                VectorConstruction range1 = VectorConstruction.NewGetRange(vectorConstruction1, RangeRestriction <long> .NewFixed(startAddress, endAddress));
                return(new Tuple <IIndex <a>, VectorConstruction>((IIndex <a>) new LinearRangeIndex <a>(index1, startAddress, endAddress), range1));
            }
            IRangeRestriction <long> indices = ((FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice2Of2)fsharpChoice).get_Item();
            IEnumerable <a>          @as     = (IEnumerable <a>) new LinearIndex.newKeys <a>(index1, indices, new long(), (IEnumerator <long>)null, 0, default(a));
            IIndex <a> index2 = builder.Create <a>(@as, (FSharpOption <bool>)null);

            LinearIndex.relocations relocations59218 = new LinearIndex.relocations();
            long   lo  = 0;
            long   hi  = index2.KeyCount - 1L;
            object obj = lo > hi ? (object)new LinearIndex.relocations(lo, hi, 1L, (Func <long, Func <long, bool> >) new LinearIndex.relocations()) : (object)new LinearIndex.relocations(lo, hi, 1L, (Func <long, Func <long, bool> >) new LinearIndex.relocations());
            IEnumerable <Tuple <long, long> > tuples = (IEnumerable <Tuple <long, long> >)SeqModule.Zip <long, long>((IEnumerable <M0>)SeqModule.Map <long, long>((Func <M0, M1>)relocations59218, (IEnumerable <M0>)obj), (IEnumerable <M1>)indices);
            VectorConstruction vectorConstruction2   = VectorConstruction.NewRelocate(vectorConstruction1, index2.KeyCount, tuples);

            return(new Tuple <IIndex <a>, VectorConstruction>(index2, vectorConstruction2));
        }
示例#2
0
        Tuple <IIndex <K>, VectorConstruction> IIndexBuilder.GetRange <K>(Tuple <IIndex <K>, VectorConstruction> _arg12, Tuple <FSharpOption <Tuple <K, BoundaryBehavior> >, FSharpOption <Tuple <K, BoundaryBehavior> > > _arg13)
        {
            Tuple <IIndex <K>, VectorConstruction> tuple1 = _arg12;
            VectorConstruction vectorConstruction         = tuple1.Item2;
            IIndex <K>         index = tuple1.Item1;
            Tuple <FSharpOption <Tuple <K, BoundaryBehavior> >, FSharpOption <Tuple <K, BoundaryBehavior> > > tuple2 = _arg13;
            FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption1 = tuple2.Item1;
            FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption2 = tuple2.Item2;
            Tuple <long, long> tuple3 = new Tuple <long, long>(0L, index.KeyCount - 1L);
            long num1 = tuple3.Item1;
            long num2 = tuple3.Item2;
            FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption3 = fsharpOption1;
            long num3;

            if (fsharpOption3 != null)
            {
                FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption4 = fsharpOption3;
                K      key    = fsharpOption4.get_Value().Item1;
                Lookup lookup = !fsharpOption4.get_Value().Item2.Equals((object)BoundaryBehavior.get_Exclusive(), LanguagePrimitives.get_GenericEqualityComparer()) ? Lookup.ExactOrGreater : Lookup.Greater;
                FSharpChoice <Unit, Tuple <K, long> > fsharpChoice = OptionalValueModule.MissingPresent <Tuple <K, long> >(index.Lookup(key, lookup, (Func <long, bool>) new LinearIndex.loBound()));
                num3 = !(fsharpChoice is FSharpChoice <Unit, Tuple <K, long> > .Choice1Of2) ? ((FSharpChoice <Unit, Tuple <K, long> > .Choice2Of2)fsharpChoice).get_Item().Item2 : num2 + 1L;
            }
            else
            {
                num3 = num1;
            }
            long startAddress = num3;
            FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption5 = fsharpOption2;
            long num4;

            if (fsharpOption5 != null)
            {
                FSharpOption <Tuple <K, BoundaryBehavior> > fsharpOption4 = fsharpOption5;
                K      key    = fsharpOption4.get_Value().Item1;
                Lookup lookup = !fsharpOption4.get_Value().Item2.Equals((object)BoundaryBehavior.get_Exclusive(), LanguagePrimitives.get_GenericEqualityComparer()) ? Lookup.ExactOrSmaller : Lookup.Smaller;
                FSharpChoice <Unit, Tuple <K, long> > fsharpChoice = OptionalValueModule.MissingPresent <Tuple <K, long> >(index.Lookup(key, lookup, (Func <long, bool>) new LinearIndex.hiBound()));
                num4 = !(fsharpChoice is FSharpChoice <Unit, Tuple <K, long> > .Choice1Of2) ? ((FSharpChoice <Unit, Tuple <K, long> > .Choice2Of2)fsharpChoice).get_Item().Item2 : num1 - 1L;
            }
            else
            {
                num4 = num2;
            }
            long endAddress = num4;

            if (endAddress < startAddress)
            {
                return(new Tuple <IIndex <K>, VectorConstruction>((IIndex <K>) new LinearIndex <K>(System.Array.AsReadOnly <K>(new K[0]), (IIndexBuilder)this, FSharpOption <bool> .Some(true)), VectorConstruction.NewEmpty(0L)));
            }
            return(new Tuple <IIndex <K>, VectorConstruction>((IIndex <K>) new LinearRangeIndex <K>(index, startAddress, endAddress), VectorConstruction.NewGetRange(vectorConstruction, RangeRestriction <long> .NewFixed(startAddress, endAddress))));
        }
示例#3
0
        Tuple <IIndex <f>, VectorConstruction> IIndexBuilder.Shift <f>(Tuple <IIndex <f>, VectorConstruction> _arg3, int offset)
        {
            Tuple <IIndex <f>, VectorConstruction> tuple1 = _arg3;
            VectorConstruction vectorConstruction         = tuple1.Item2;
            IIndex <f>         index = tuple1.Item1;
            Tuple <Tuple <long, long>, RangeRestriction <long> > tuple2 = offset <= 0 ? new Tuple <Tuple <long, long>, RangeRestriction <long> >(new Tuple <long, long>(0L, index.KeyCount - 1L + (long)offset), RangeRestriction <long> .NewFixed((long)-offset, index.KeyCount - 1L)) : new Tuple <Tuple <long, long>, RangeRestriction <long> >(new Tuple <long, long>((long)offset, index.KeyCount - 1L), RangeRestriction <long> .NewFixed(0L, index.KeyCount - 1L - (long)offset));
            RangeRestriction <long> rangeRestriction = tuple2.Item2;
            long startAddress = tuple2.Item1.Item1;
            long endAddress   = tuple2.Item1.Item2;

            if (startAddress > endAddress)
            {
                ReadOnlyCollection <f> keys = ReadOnlyCollection.empty <f>();
                if (LinearIndexBuilder.init < 5)
                {
                    LanguagePrimitives.IntrinsicFunctions.FailStaticInit();
                }
                LinearIndexBuilder  indexBuilder = LinearIndexBuilder.indexBuilder;
                FSharpOption <bool> ordered      = FSharpOption <bool> .Some(true);

                return(new Tuple <IIndex <f>, VectorConstruction>((IIndex <f>) new LinearIndex <f>(keys, (IIndexBuilder)indexBuilder, ordered), VectorConstruction.NewEmpty(0L)));
            }
            FSharpOption <bool> fsharpOption = !index.IsOrdered ? (FSharpOption <bool>)null : FSharpOption <bool> .Some(true);

            return(new Tuple <IIndex <f>, VectorConstruction>(!LanguagePrimitives.HashCompare.GenericEqualityIntrinsic <Addressing.IAddressingScheme>((M0)index.AddressingScheme, (M0)Addressing.LinearAddressingScheme.Instance) ? (IIndex <f>) new LinearIndex <f>(ReadOnlyCollectionExtensions.ReadOnlyCollection ` 1GetSlice < f > (index.Keys, FSharpOption <int> .Some((int)startAddress), FSharpOption <int> .Some((int)endAddress)), LinearIndexBuilder.Instance, FSharpOption <bool> .Some(index.IsOrdered)) : (IIndex <f>) new LinearRangeIndex <f>(index, startAddress, endAddress), VectorConstruction.NewGetRange(vectorConstruction, rangeRestriction)));
        }