Ejemplo n.º 1
0
        Tuple <IIndex <K>, VectorConstruction> IIndexBuilder.Merge <K>(FSharpList <Tuple <IIndex <K>, VectorConstruction> > constructions, VectorListTransform transform)
        {
            bool flag = ListModule.ForAll <Tuple <IIndex <K>, VectorConstruction> >((Func <M0, bool>) new LinearIndex.allOrdered <K>(), (FSharpList <M0>)constructions);
            Func <IComparer <K>, Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > > Func1 = (Func <IComparer <K>, Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > >) new LinearIndex.mergeOrdered <K>(constructions);
            Func <Unit, Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > >          Func2 = (Func <Unit, Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > >) new LinearIndex.mergeUnordered <K>(constructions);
            Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > tuple1;

            if (flag)
            {
                Comparer <K> comparer = ((Tuple <IIndex <K>, VectorConstruction>)ListModule.Head <Tuple <IIndex <K>, VectorConstruction> >((FSharpList <M0>)constructions)).Item1.Comparer;
                Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > tuple2;
                try
                {
                    tuple2 = Func1.Invoke((IComparer <K>)comparer);
                }
                catch (object ex)
                {
                    if ((Exception)ex is ComparisonFailedException)
                    {
                        tuple2 = Func2.Invoke((Unit)null);
                    }
                    else
                    {
                        throw;
                    }
                }
                tuple1 = tuple2;
            }
            else
            {
                tuple1 = Func2.Invoke((Unit)null);
            }
            Tuple <Tuple <K[], FSharpList <Tuple <long, long>[]> >, FSharpOption <bool> > tuple3 = tuple1;
            FSharpOption <bool> fsharpOption = tuple3.Item2;
            Tuple <K[], FSharpList <Tuple <long, long>[]> > tuple4 = tuple3.Item1;
            IEnumerable <VectorConstruction> fsharpList1           = (IEnumerable <VectorConstruction>)ListModule.Map <Tuple <IIndex <K>, VectorConstruction>, VectorConstruction>((Func <M0, M1>) new LinearIndex.vectors <K>(), (FSharpList <M0>)constructions);
            LinearIndexBuilder linearIndexBuilder = this;
            Tuple <K[], FSharpList <Tuple <long, long>[]> > tuple5 = tuple4;
            IEnumerable <VectorConstruction> vectors = fsharpList1;
            FSharpOption <bool> ordered = fsharpOption;

            K[] keys = tuple5.Item1;
            FSharpList <Tuple <long, long>[]> relocations = tuple5.Item2;
            Tuple <IIndex <K>, IEnumerable <VectorConstruction> > tuple6 = linearIndexBuilder.makeSeriesConstructions <K>(keys, relocations, vectors, ordered);
            IEnumerable <VectorConstruction> fsharpList2 = tuple6.Item2;
            IIndex <K> newIndex = tuple6.Item1;

            return(new Tuple <IIndex <K>, VectorConstruction>(newIndex, VectorConstruction.NewCombine((Lazy <long>)LazyExtensions.Create <long>((Func <Unit, M0>) new LinearIndex.DeedleIndicesIIndexBuilderMerge <K>(newIndex)), fsharpList2, transform)));
        }