コード例 #1
0
 public ImportDataCommandHandler(IStandardsImportService standardsImportService, ILarsImportService larsImportService, IFrameworksImportService frameworksImportService, IIndexBuilder indexBuilder)
 {
     _standardsImportService  = standardsImportService;
     _larsImportService       = larsImportService;
     _frameworksImportService = frameworksImportService;
     _indexBuilder            = indexBuilder;
 }
コード例 #2
0
            public virtual int GenerateNext(ref IEnumerable <IIndexBuilder> next)
            {
                switch (this.pc)
                {
                case 1:
label_5:
                    this.pc = 3;
                    LanguagePrimitives.IntrinsicFunctions.Dispose <IEnumerator <b> >((M0)this.@enum);
                    this.@enum = (IEnumerator <b>)null;
                    this.pc    = 3;
                    goto case 3;

                case 2:
                    this.s = default(b);
                    break;

                case 3:
                    this.current = (IIndexBuilder)null;
                    return(0);

                default:
                    this.@enum = ((IEnumerable <b>) this.values).GetEnumerator();
                    this.pc    = 1;
                    break;
                }
                if ([email protected]())
                {
                    this.s       = [email protected];
                    this.pc      = 2;
                    this.current = this.s.Index.Builder;
                    return(1);
                }
                goto label_5;
            }
コード例 #3
0
 protected virtual void VisitIndex(ICreateBuilder expression, IIndexBuilder index)
 {
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.CREATE);
     if (index.Index.Flags.HasFlag(IndexFlags.Unique))
     {
         this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.UNIQUE);
     }
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.INDEX);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.Identifier(Conventions.IndexName(index.Index)));
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.ON);
     this.Visit(index.Table);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.OPEN_PARENTHESES);
     this.Visit(index.Columns);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.CLOSE_PARENTHESES);
     if (index.Index.Expression != null && !index.Index.Expression.IsEmpty())
     {
         this.Visitor.Visit(
             this,
             this.Graph,
             this.Fragment <IFilterBuilder>().With(
                 filter => filter.Expressions.Add(index.Index.Expression)
                 )
             );
     }
 }
コード例 #4
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IIndexBuilder indexBuilder, ILogger <Startup> logger)
        {
            indexBuilder.Build();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "CoursesAPI v1");
                c.SwaggerEndpoint("/swagger/operations/swagger.json", "Operations v1");
                c.RoutePrefix = string.Empty;
            });

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.ConfigureExceptionHandler(logger);

            app.UseAuthentication();

            if (!_configuration["Environment"].Equals("DEV", StringComparison.CurrentCultureIgnoreCase))
            {
                app.UseHealthChecks();
            }

            app.UseRouting();
            app.UseEndpoints(builder =>
            {
                builder.MapControllerRoute(
                    name: "default",
                    pattern: "api/{controller=Standards}/{action=Index}/{id?}");
            });
        }
コード例 #5
0
 public SchemaBuilder(IDbContext dbContext, IPluralize pluralize)
 {
     ProcedureBuilder = new ProcedureBuilder(dbContext, pluralize);
     TableBuilder     = new TableBuilder(dbContext, pluralize);
     FullTextBuilder  = new FullTextBuilder(dbContext, pluralize);
     IndexBuilder     = new IndexBuilder(dbContext, pluralize);
 }
コード例 #6
0
        public static SqlServerIndexBuilder ForSqlServer <TIndexBuilder>(
            [NotNull] this IIndexBuilder <TIndexBuilder> indexBuilder)
            where TIndexBuilder : IIndexBuilder <TIndexBuilder>
        {
            Check.NotNull(indexBuilder, "indexBuilder");

            return(new SqlServerIndexBuilder(indexBuilder.Metadata));
        }
コード例 #7
0
        public static RelationalIndexBuilder ForRelational <TIndexBuilder>(
            [NotNull] this IIndexBuilder <TIndexBuilder> indexBuilder)
            where TIndexBuilder : IIndexBuilder <TIndexBuilder>
        {
            Check.NotNull(indexBuilder, "indexBuilder");

            return(new RelationalIndexBuilder(indexBuilder.Metadata));
        }
コード例 #8
0
ファイル: IndexComparer.cs プロジェクト: Raimusoft/FoxDb
 public int GetHashCode(IIndexBuilder builder)
 {
     if (builder == null)
     {
         return(0);
     }
     return(builder.GetHashCode());
 }
コード例 #9
0
        public ColumnSeries(IIndex <TColumnKey> index, IVector <ObjectSeries <TRowKey> > vector, IVectorBuilder vectorBuilder, IIndexBuilder indexBuilder)
            : base(index, vector, vectorBuilder, indexBuilder)
        {
            ColumnSeries <TRowKey, TColumnKey> columnSeries = this;

            this.vectorBuilder = vectorBuilder;
            this.indexBuilder  = indexBuilder;
        }
コード例 #10
0
        public static TBuilder SharedNameExtension <TBuilder>(this IIndexBuilder <TBuilder> builder, string value)
            where TBuilder : IIndexBuilder <TBuilder>
        {
            builder.Annotation("Annotation", value + ".Annotation");
            builder.Metadata["Metadata"] = value + ".Metadata";
            builder.Model["Model"]       = value + ".Model";

            return((TBuilder)builder);
        }
コード例 #11
0
 public ibs(b[] values, b s, IEnumerator <b> @enum, int pc, IIndexBuilder current)
 {
     this.values  = values;
     this.s       = s;
     this.@enum   = @enum;
     this.pc      = pc;
     this.current = current;
     this.ctor();
 }
コード例 #12
0
ファイル: DataFrame.cs プロジェクト: mpodkolzin/NumPi
        //public GetRowKeyAt(Int64 address) =>

        public DataFrame(IIndex <TRowKey> rowIndex, IIndex <TColumnKey> columnIndex, IVector <IVector> data, IIndexBuilder indexBuilder, IVectorBuilder vectorBuilder)
        {
            //TODO add error handling
            _data          = data;
            _rowIndex      = rowIndex;
            _columnIndex   = columnIndex;
            _vectorBuilder = vectorBuilder;
            _indexBuilder  = indexBuilder;
        }
コード例 #13
0
        internal ObjectSeries(IIndex <K> index, IVector <object> vector, IVectorBuilder vectorBuilder, IIndexBuilder indexBuilder)
            : base(index, vector, vectorBuilder, indexBuilder)
        {
            ObjectSeries <K> objectSeries = this;

            this.index         = index;
            this.vector        = vector;
            this.vectorBuilder = vectorBuilder;
            this.indexBuilder  = indexBuilder;
        }
コード例 #14
0
        public static Series <K, V> FromValueLoader <K, V>(K min, K max, FSharpFunc <Tuple <K, BoundaryBehavior>, FSharpFunc <Tuple <K, BoundaryBehavior>, FSharpAsync <IEnumerable <KeyValuePair <K, V> > > > > loader)
        {
            IVectorBuilder instance1 = FVectorBuilderimplementation.VectorBuilder.Instance;
            IIndexBuilder  instance2 = FIndexBuilderimplementation.IndexBuilder.Instance;

            Ranges.Ranges <K> ranges = Ranges.Ranges <K> .NewRange(new Tuple <Tuple <K, BoundaryBehavior>, Tuple <K, BoundaryBehavior> >(new Tuple <K, BoundaryBehavior>(min, BoundaryBehavior.get_Inclusive()), new Tuple <K, BoundaryBehavior>(max, BoundaryBehavior.get_Inclusive())));

            DelayedSource <K, V> source = new DelayedSource <K, V>(Addressing.LinearAddressingScheme.Instance, min, max, ranges, instance2, instance1, (FSharpFunc <Tuple <Tuple <K, BoundaryBehavior>, Tuple <K, BoundaryBehavior> >[], FSharpAsync <Tuple <IIndex <K>, IVector <V> > >[]>) new DelayedSeries.source <K, V>(loader, instance1, instance2));

            return(new Series <K, V>((IIndex <K>) new DelayedIndex <K, V>(source), (IVector <V>) new DelayedVector <K, V>(source), instance1, (IIndexBuilder) new DelayedIndexBuilder()));
        }
コード例 #15
0
        ReadOnlyCollection <Tuple <TNewKey, Tuple <IIndex <K>, VectorConstruction> > > IIndexBuilder.GroupBy <K, TNewKey>(IIndex <K> index, Func <K, TNewKey> keySel, VectorConstruction vector)
        {
            IIndexBuilder builder = (IIndexBuilder)this;

            LinearIndex.windows <K, TNewKey>                 windows336 = new LinearIndex.windows <K, TNewKey>();
            ReadOnlyCollection <K>                           keys       = index.Keys;
            IEnumerable <Tuple <M1, IEnumerable <M0> > >     tuples1    = SeqModule.GroupBy <K, TNewKey>((Func <M0, M1>)keySel, (IEnumerable <M0>)keys);
            IEnumerable <Tuple <TNewKey, IEnumerable <K> > > tuples2    = (IEnumerable <Tuple <TNewKey, IEnumerable <K> > >)SeqModule.Choose <Tuple <TNewKey, IEnumerable <K> >, Tuple <TNewKey, IEnumerable <K> > >((Func <M0, FSharpOption <M1> >)windows336, (IEnumerable <M0>)tuples1);

            return(System.Array.AsReadOnly <Tuple <TNewKey, Tuple <IIndex <K>, VectorConstruction> > >((Tuple <TNewKey, Tuple <IIndex <K>, VectorConstruction> >[])ArrayModule.OfSeq <Tuple <TNewKey, Tuple <IIndex <K>, VectorConstruction> > >((IEnumerable <M0>)SeqModule.Map <Tuple <TNewKey, IEnumerable <K> >, Tuple <TNewKey, Tuple <IIndex <K>, VectorConstruction> > >((Func <M0, M1>) new LinearIndex.DeedleIndicesIIndexBuilderGroupBy <K, TNewKey>(index, vector, builder), (IEnumerable <M0>)tuples2))));
        }
コード例 #16
0
        public static TIndexBuilder ForRelational <TIndexBuilder>(
            [NotNull] this IIndexBuilder <TIndexBuilder> indexBuilder,
            [NotNull] Action <RelationalIndexBuilder> relationalIndexBuilder)
            where TIndexBuilder : IIndexBuilder <TIndexBuilder>
        {
            Check.NotNull(indexBuilder, "indexBuilder");
            Check.NotNull(relationalIndexBuilder, "relationalIndexBuilder");

            relationalIndexBuilder(ForRelational(indexBuilder));

            return((TIndexBuilder)indexBuilder);
        }
コード例 #17
0
 protected override void VisitIndex(ICreateBuilder expression, IIndexBuilder index)
 {
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.CREATE);
     if (index.Index.Flags.HasFlag(IndexFlags.Unique))
     {
         this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.UNIQUE);
     }
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.INDEX);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.Identifier(Conventions.IndexName(index.Index)));
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.ON);
     this.Visit(index.Table);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.OPEN_PARENTHESES);
     this.Visit(index.Columns);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.CLOSE_PARENTHESES);
 }
コード例 #18
0
            public virtual void Close()
            {
                Exception exception = (Exception)null;

                while (true)
                {
                    switch (this.pc)
                    {
                    case 3:
                        goto label_8;

                    default:
                        Unit unit;
                        try
                        {
                            switch (this.pc)
                            {
                            case 0:
                            case 3:
                                this.pc      = 3;
                                this.current = (IIndexBuilder)null;
                                unit         = (Unit)null;
                                break;

                            case 1:
                                this.pc = 3;
                                LanguagePrimitives.IntrinsicFunctions.Dispose <IEnumerator <b> >((M0)this.@enum);
                                goto case 0;

                            default:
                                goto case 1;
                            }
                        }
                        catch (object ex)
                        {
                            exception = (Exception)ex;
                            unit      = (Unit)null;
                        }
                        continue;
                    }
                }
label_8:
                if (exception != null)
                {
                    throw exception;
                }
            }
コード例 #19
0
 public Catalog2AzureSearchCommand(
     ICollector collector,
     IStorageFactory storageFactory,
     Func <HttpMessageHandler> handlerFunc,
     IBlobContainerBuilder blobContainerBuilder,
     IIndexBuilder indexBuilder,
     IOptionsSnapshot <Catalog2AzureSearchConfiguration> options,
     ILogger <Catalog2AzureSearchCommand> logger)
 {
     _collector            = collector ?? throw new ArgumentNullException(nameof(collector));
     _storageFactory       = storageFactory ?? throw new ArgumentNullException(nameof(storageFactory));
     _handlerFunc          = handlerFunc ?? throw new ArgumentNullException(nameof(handlerFunc));
     _blobContainerBuilder = blobContainerBuilder ?? throw new ArgumentNullException(nameof(blobContainerBuilder));
     _indexBuilder         = indexBuilder ?? throw new ArgumentNullException(nameof(indexBuilder));
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _logger  = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #20
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));
        }
コード例 #21
0
        public static IIndex <TDatabase, TTable> Index <TDatabase, TTable>(this IIndexBuilder <TDatabase, TTable> @this,
                                                                           Expression <Func <IOrderFilter <TTable>, object> > keyColumns,
                                                                           bool unique    = false,
                                                                           string name    = null,
                                                                           bool clustered = false,
                                                                           Expression <Func <TTable, object> > includedColumns = null)
        {
            var builder = @this as InternalTableBuilder <TDatabase, TTable>;

            var indexKeyColumns      = ExpressionHelpers.ParseOrderedMultiPropertySelector(keyColumns ?? throw ModelBuilderError.ArgumentNull(nameof(keyColumns)).AsException()).MatchColumns(builder.Name, builder.Columns);
            var indexIncludedColumns = includedColumns == null?ImmutableArray.Create <ColumnModel>() : ExpressionHelpers.ParseMultiPropertySelector(includedColumns).MatchColumns(builder.Name, builder.Columns);

            var indexName = name ?? BuilderHelper.GenerateKeyName("IX", builder.Schema, builder.Name, indexKeyColumns.Select(c => c.Name));

            if (clustered)
            {
                var priorClustered = builder.PrimaryKey?.IsClustered == true ? builder.PrimaryKey.Name
                                                                             : builder.Indexes.FirstOrDefault(i => i.IsClustered)?.Name;
                if (priorClustered != null)
                {
                    throw ModelBuilderError.IndexClusteredAlreadySpecified(priorClustered).AsException();
                }
            }

            {
                var column = indexIncludedColumns.FirstOrDefault(i => indexKeyColumns.Any(k => k.Property.Name == i.Property.Name));
                if (column != null)
                {
                    throw ModelBuilderError.IndexIncludedColumnAlreadyInKeyColumns(column.Name).AsException();
                }
            }

            builder.Indexes.Add(new IndexModel(name: indexName,
                                               keyColumns: indexKeyColumns.ToImmutableArray(),
                                               isUnique: unique,
                                               isClustered: clustered,
                                               includedColumns: indexIncludedColumns.ToImmutableArray()));

            return(builder);
        }
コード例 #22
0
        public Db2AzureSearchCommand(
            INewPackageRegistrationProducer producer,
            IPackageEntityIndexActionBuilder indexActionBuilder,
            IBlobContainerBuilder blobContainerBuilder,
            IIndexBuilder indexBuilder,
            Func <IBatchPusher> batchPusherFactory,
            ICatalogClient catalogClient,
            IStorageFactory storageFactory,
            IOwnerDataClient ownerDataClient,
            IDownloadDataClient downloadDataClient,
            IVerifiedPackagesDataClient verifiedPackagesDataClient,
            IPopularityTransferDataClient popularityTransferDataClient,
            IOptionsSnapshot <Db2AzureSearchConfiguration> options,
            IOptionsSnapshot <Db2AzureSearchDevelopmentConfiguration> developmentOptions,
            ILogger <Db2AzureSearchCommand> logger)
        {
            _producer                     = producer ?? throw new ArgumentNullException(nameof(producer));
            _indexActionBuilder           = indexActionBuilder ?? throw new ArgumentNullException(nameof(indexActionBuilder));
            _blobContainerBuilder         = blobContainerBuilder ?? throw new ArgumentNullException(nameof(blobContainerBuilder));
            _indexBuilder                 = indexBuilder ?? throw new ArgumentNullException(nameof(indexBuilder));
            _batchPusherFactory           = batchPusherFactory ?? throw new ArgumentNullException(nameof(batchPusherFactory));
            _catalogClient                = catalogClient ?? throw new ArgumentNullException(nameof(catalogClient));
            _storageFactory               = storageFactory ?? throw new ArgumentNullException(nameof(storageFactory));
            _ownerDataClient              = ownerDataClient ?? throw new ArgumentNullException(nameof(ownerDataClient));
            _downloadDataClient           = downloadDataClient ?? throw new ArgumentNullException(nameof(downloadDataClient));
            _verifiedPackagesDataClient   = verifiedPackagesDataClient ?? throw new ArgumentNullException(nameof(verifiedPackagesDataClient));
            _popularityTransferDataClient = popularityTransferDataClient ?? throw new ArgumentNullException(nameof(popularityTransferDataClient));
            _options            = options ?? throw new ArgumentNullException(nameof(options));
            _developmentOptions = developmentOptions ?? throw new ArgumentNullException(nameof(developmentOptions));
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));

            if (_options.Value.MaxConcurrentBatches <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentBatches)} must be greater than zero.");
            }
        }
コード例 #23
0
        Tuple <IIndex <TNewKey>, IVector <R> > IIndexBuilder.Aggregate <K, TNewKey, R>(IIndex <K> index, Aggregation <K> aggregation, VectorConstruction vector, Func <Tuple <DataSegmentKind, Tuple <IIndex <K>, VectorConstruction> >, Tuple <TNewKey, R> > selector)
        {
            if (!index.IsOrdered)
            {
                throw new InvalidOperationException("Floating window aggregation and chunking is only supported on ordered indices. Consider sorting the series before calling the operation.");
            }
            IIndexBuilder   indexBuilder1 = (IIndexBuilder)this;
            Aggregation <K> aggregation1  = aggregation;
            IEnumerable <Tuple <DataSegmentKind, long, long> > tuples1;

            switch (aggregation1.get_Tag())
            {
            case 0:
                Aggregation <K> .WindowSize windowSize = (Aggregation <K> .WindowSize)aggregation1;
                tuples1 = Seq.windowRangesWithBounds((long)windowSize.item1, windowSize.item2, index.KeyCount);
                break;

            case 2:
                tuples1 = (IEnumerable <Tuple <DataSegmentKind, long, long> >)SeqModule.Map <Tuple <long, long>, Tuple <DataSegmentKind, long, long> >((Func <M0, M1>) new LinearIndex.locations(), (IEnumerable <M0>)Seq.windowRangesWhile <K>(((Aggregation <K> .WindowWhile)aggregation1).item, (IEnumerable <K>)index.Keys));
                break;

            case 3:
                tuples1 = (IEnumerable <Tuple <DataSegmentKind, long, long> >)SeqModule.Map <Tuple <long, long>, Tuple <DataSegmentKind, long, long> >((Func <M0, M1>) new LinearIndex.locations(), (IEnumerable <M0>)Seq.chunkRangesWhile <K>(((Aggregation <K> .ChunkWhile)aggregation1).item, (IEnumerable <K>)index.Keys));
                break;

            default:
                Aggregation <K> .ChunkSize chunkSize = (Aggregation <K> .ChunkSize)aggregation1;
                tuples1 = Seq.chunkRangesWithBounds((long)chunkSize.item1, chunkSize.item2, index.KeyCount);
                break;
            }
            IEnumerable <Tuple <DataSegmentKind, long, long> > tuples2 = tuples1;
            IEnumerable <Tuple <DataSegmentKind, Tuple <IIndex <K>, VectorConstruction> > > tuples3 = (IEnumerable <Tuple <DataSegmentKind, Tuple <IIndex <K>, VectorConstruction> > >)SeqModule.Map <Tuple <DataSegmentKind, long, long>, Tuple <DataSegmentKind, Tuple <IIndex <K>, VectorConstruction> > >((Func <M0, M1>) new LinearIndex.vectorConstructions <K>(index, vector), (IEnumerable <M0>)tuples2);

            Tuple <TNewKey, R>[] tupleArray1         = (Tuple <TNewKey, R>[])ArrayModule.OfSeq <Tuple <TNewKey, R> >((IEnumerable <M0>)SeqModule.Map <Tuple <DataSegmentKind, Tuple <IIndex <K>, VectorConstruction> >, Tuple <TNewKey, R> >((Func <M0, M1>)selector, (IEnumerable <M0>)tuples3));
            IIndexBuilder        indexBuilder2       = indexBuilder1;
            Func <Tuple <TNewKey, R>, TNewKey> Func1 = (Func <Tuple <TNewKey, R>, TNewKey>) new LinearIndex.newIndex <TNewKey, R>();

            Tuple <TNewKey, R>[] tupleArray2 = tupleArray1;
            if ((object)tupleArray2 == null)
            {
                throw new ArgumentNullException("array");
            }
            TNewKey[]     array         = new TNewKey[tupleArray2.Length];
            IIndexBuilder indexBuilder3 = indexBuilder2;

            for (int index1 = 0; index1 < array.Length; ++index1)
            {
                array[index1] = Func1.Invoke(tupleArray2[index1]);
            }
            IIndex <TNewKey>             index2         = indexBuilder3.Create <TNewKey>(System.Array.AsReadOnly <TNewKey>(array), (FSharpOption <bool>)null);
            IVectorBuilder               vectorBuilder1 = this.vectorBuilder;
            Func <Tuple <TNewKey, R>, R> Func2          = (Func <Tuple <TNewKey, R>, R>) new LinearIndex.vect <TNewKey, R>();

            Tuple <TNewKey, R>[] tupleArray3 = tupleArray1;
            if ((object)tupleArray3 == null)
            {
                throw new ArgumentNullException("array");
            }
            R[]            optionalValueArray = new R[tupleArray3.Length];
            IVectorBuilder vectorBuilder2     = vectorBuilder1;

            for (int index1 = 0; index1 < optionalValueArray.Length; ++index1)
            {
                optionalValueArray[index1] = Func2.Invoke(tupleArray3[index1]);
            }
            IVector <R> missing = vectorBuilder2.CreateMissing <R>(optionalValueArray);

            return(new Tuple <IIndex <TNewKey>, IVector <R> >(index2, missing));
        }
コード例 #24
0
        Tuple <IIndex <TNewKey>, IVector <R> > IIndexBuilder.Resample <K, TNewKey, R>(IIndexBuilder chunkBuilder, IIndex <K> index, IEnumerable <K> keys, Deedle.Direction dir, VectorConstruction vector, Func <Tuple <K, Tuple <IIndex <K>, VectorConstruction> >, Tuple <TNewKey, R> > selector)
        {
            if (!index.IsOrdered)
            {
                throw new InvalidOperationException("Resampling is only supported on ordered indices");
            }
            IIndexBuilder    indexBuilder = (IIndexBuilder)this;
            IEnumerable <M1> m1s;

            if (dir == Deedle.Direction.Forward)
            {
                IEnumerable <Tuple <K, long> > tuples = (IEnumerable <Tuple <K, long> >)SeqModule.Map <K, Tuple <K, long> >((Func <M0, M1>) new LinearIndex.keyLocations <K>(index), keys);
                m1s = SeqModule.MapIndexed <Tuple <Tuple <K, long>, Tuple <K, long> >, Tuple <K, Tuple <long, long> > >((Func <int, Func <M0, M1> >) new LinearIndex.locations <K>(index), (IEnumerable <M0>)SeqModule.Pairwise <Tuple <K, long> >(SeqModule.Append <Tuple <K, long> >((IEnumerable <M0>)tuples, (IEnumerable <M0>)FSharpList <Tuple <K, long> > .Cons(new Tuple <K, long>(default(K), Addressing.LinearAddress.invalid), FSharpList <Tuple <K, long> > .get_Empty()))));
            }
            else
            {
                int keyLen = SeqModule.Length <K>(keys);
                IEnumerable <Tuple <K, long> > tuples = (IEnumerable <Tuple <K, long> >)SeqModule.Map <K, Tuple <K, long> >((Func <M0, M1>) new LinearIndex.keyLocations <K>(index), keys);
                m1s = SeqModule.MapIndexed <Tuple <Tuple <K, long>, Tuple <K, long> >, Tuple <K, Tuple <long, long> > >((Func <int, Func <M0, M1> >) new LinearIndex.locations <K>(index, keyLen), (IEnumerable <M0>)SeqModule.Pairwise <Tuple <K, long> >(SeqModule.Append <Tuple <K, long> >((IEnumerable <M0>)FSharpList <Tuple <K, long> > .Cons(new Tuple <K, long>(default(K), Addressing.LinearAddress.invalid), FSharpList <Tuple <K, long> > .get_Empty()), (IEnumerable <M0>)tuples)));
            }
            Tuple <K, Tuple <long, long> >[] tupleArray1 = (Tuple <K, Tuple <long, long> >[])ArrayModule.OfSeq <Tuple <K, Tuple <long, long> > >((IEnumerable <M0>)m1s);
            Func <Tuple <K, Tuple <long, long> >, Tuple <K, Tuple <IIndex <K>, VectorConstruction> > > Func1 = (Func <Tuple <K, Tuple <long, long> >, Tuple <K, Tuple <IIndex <K>, VectorConstruction> > >) new LinearIndex.vectorConstructions <K>(chunkBuilder, index);

            Tuple <K, Tuple <long, long> >[] tupleArray2 = tupleArray1;
            if ((object)tupleArray2 == null)
            {
                throw new ArgumentNullException("array");
            }
            Tuple <K, Tuple <IIndex <K>, VectorConstruction> >[] tupleArray3 = new Tuple <K, Tuple <IIndex <K>, VectorConstruction> > [tupleArray2.Length];
            for (int index1 = 0; index1 < tupleArray3.Length; ++index1)
            {
                tupleArray3[index1] = Func1.Invoke(tupleArray2[index1]);
            }
            Tuple <K, Tuple <IIndex <K>, VectorConstruction> >[] tupleArray4 = tupleArray3;
            Func <Tuple <K, Tuple <IIndex <K>, VectorConstruction> >, Tuple <TNewKey, R> > Func2 = selector;

            Tuple <K, Tuple <IIndex <K>, VectorConstruction> >[] tupleArray5 = tupleArray4;
            if ((object)tupleArray5 == null)
            {
                throw new ArgumentNullException("array");
            }
            Tuple <TNewKey, R>[] tupleArray6 = new Tuple <TNewKey, R> [tupleArray5.Length];
            for (int index1 = 0; index1 < tupleArray6.Length; ++index1)
            {
                tupleArray6[index1] = Func2.Invoke(tupleArray5[index1]);
            }
            Tuple <TNewKey, R>[]         tupleArray7    = tupleArray6;
            IIndex <TNewKey>             index2         = indexBuilder.Create <TNewKey>(SeqModule.Map <Tuple <TNewKey, R>, TNewKey>((Func <M0, M1>) new LinearIndex.newIndex <TNewKey, R>(), (IEnumerable <M0>)tupleArray7), (FSharpOption <bool>)null);
            IVectorBuilder               vectorBuilder1 = this.vectorBuilder;
            Func <Tuple <TNewKey, R>, R> Func3          = (Func <Tuple <TNewKey, R>, R>) new LinearIndex.vect <TNewKey, R>();

            Tuple <TNewKey, R>[] tupleArray8 = tupleArray7;
            if ((object)tupleArray8 == null)
            {
                throw new ArgumentNullException("array");
            }
            R[]            optionalValueArray = new R[tupleArray8.Length];
            IVectorBuilder vectorBuilder2     = vectorBuilder1;

            for (int index1 = 0; index1 < optionalValueArray.Length; ++index1)
            {
                optionalValueArray[index1] = Func3.Invoke(tupleArray8[index1]);
            }
            IVector <R> missing = vectorBuilder2.CreateMissing <R>(optionalValueArray);

            return(new Tuple <IIndex <TNewKey>, IVector <R> >(index2, missing));
        }
コード例 #25
0
ファイル: Project.cs プロジェクト: JadeHub/LibClangCS
 public Project(string name, IIndexBuilder indexBuilder)
 {
     _name = name;
     _indexer = indexBuilder;
 }
コード例 #26
0
 protected virtual void VisitIndex(IIndexBuilder expression)
 {
     throw new NotImplementedException();
 }
コード例 #27
0
 protected virtual void VisitIndex(IDropBuilder expression, IIndexBuilder index)
 {
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.DROP);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.INDEX);
     this.Builder.AppendFormat("{0} ", this.Database.QueryFactory.Dialect.Identifier(Conventions.IndexName(index.Index)));
 }
コード例 #28
0
ファイル: IndexComparer.cs プロジェクト: Raimusoft/FoxDb
 public bool Equals(IIndexBuilder left, IIndexBuilder right)
 {
     return((IndexBuilder)left == (IndexBuilder)right);
 }
コード例 #29
0
ファイル: IndexComparer.cs プロジェクト: Raimusoft/FoxDb
 public static Func <IIndexBuilder, bool> Equals(IIndexBuilder index)
 {
     return(other => IndexBuilder.Equals(index, other));
 }
コード例 #30
0
 public RowSequence(IIndex <TRowKey> index, IVector <ObjectSequence <TColumnKey> > vector, IVectorBuilder vectorBuilder, IIndexBuilder indexBuilder)
     : base(index, vector, vectorBuilder, indexBuilder)
 {
 }
コード例 #31
0
        internal static Tuple <IIndex <a>, VectorConstruction, VectorConstruction> createJoinTransformation <a>(IIndexBuilder indexBuilder, IIndexBuilder otherIndexBuilder, JoinKind kind, Lookup lookup, IIndex <a> thisIndex, IIndex <a> otherIndex, VectorConstruction thisVector, VectorConstruction otherVector)
        {
            if ((lookup == Lookup.Exact ? 0 : (kind == JoinKind.Inner ? 1 : 0)) != 0)
            {
                throw new InvalidOperationException("Join/Zip - Inner join can only be used with Lookup.Exact.");
            }
            if ((lookup == Lookup.Exact ? 0 : (kind == JoinKind.Outer ? 1 : 0)) != 0)
            {
                throw new InvalidOperationException("Join/Zip - Outer join can only be used with Lookup.Exact.");
            }
            if (((!thisIndex.IsOrdered ? 0 : (otherIndex.IsOrdered ? 1 : 0)) != 0 ? 0 : (lookup != Lookup.Exact ? 1 : 0)) != 0)
            {
                throw new InvalidOperationException("Join/Zip - Lookup can be only used when joining/zipping ordered series/frames.");
            }
            JoinKind input = kind;
            Tuple <Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >, JoinKind> tuple1 = MatchingHelpers.Let <Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >, JoinKind>(new Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >(thisVector, otherVector, thisIndex, otherIndex, (FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > >) new JoinHelpers.createJoinTransformation <a>()), input);
            IIndex <a>         sourceIndex;
            VectorConstruction vector1;
            FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > fsharpFunc1;
            IIndex <a>         restriction;
            VectorConstruction vectorConstruction1;

            switch (tuple1.Item2)
            {
            case JoinKind.Left:
                VectorConstruction vectorConstruction2 = tuple1.Item1.Item1;
                IIndex <a>         index1 = tuple1.Item1.Item3;
                FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > fsharpFunc2 = tuple1.Item1.Item5;
                VectorConstruction vectorConstruction3 = tuple1.Item1.Item2;
                sourceIndex         = tuple1.Item1.Item4;
                vector1             = vectorConstruction3;
                fsharpFunc1         = fsharpFunc2;
                restriction         = index1;
                vectorConstruction1 = vectorConstruction2;
                break;

            default:
                Tuple <Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >, JoinKind> tuple2 = MatchingHelpers.Let <Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >, JoinKind>(new Tuple <VectorConstruction, VectorConstruction, IIndex <a>, IIndex <a>, FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > > >(thisVector, otherVector, thisIndex, otherIndex, (FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> > > >) new JoinHelpers.createJoinTransformation <a>()), input);
                switch (tuple2.Item2)
                {
                case JoinKind.Right:
                    vectorConstruction1 = tuple2.Item1.Item2;
                    restriction         = tuple2.Item1.Item4;
                    fsharpFunc1         = tuple2.Item1.Item5;
                    vector1             = tuple2.Item1.Item1;
                    sourceIndex         = tuple2.Item1.Item3;
                    break;

                default:
                    switch (input)
                    {
                    case JoinKind.Outer:
                        if ((!object.ReferenceEquals((object)thisIndex, (object)otherIndex) ? (LanguagePrimitives.HashCompare.GenericEqualityIntrinsic <IIndex <a> >((M0)thisIndex, (M0)otherIndex) ? 1 : 0) : 1) == 0)
                        {
                            goto default;
                        }
                        else
                        {
                            break;
                        }

                    case JoinKind.Inner:
                        if ((!object.ReferenceEquals((object)thisIndex, (object)otherIndex) ? (LanguagePrimitives.HashCompare.GenericEqualityIntrinsic <IIndex <a> >((M0)thisIndex, (M0)otherIndex) ? 1 : 0) : 1) == 0)
                        {
                            goto default;
                        }
                        else
                        {
                            break;
                        }

                    default:
                        switch (input)
                        {
                        case JoinKind.Outer:
                            return(indexBuilder.Union <a>(new Tuple <IIndex <a>, VectorConstruction>(thisIndex, thisVector), new Tuple <IIndex <a>, VectorConstruction>(otherIndex, otherVector)));

                        case JoinKind.Inner:
                            return(indexBuilder.Intersect <a>(new Tuple <IIndex <a>, VectorConstruction>(thisIndex, thisVector), new Tuple <IIndex <a>, VectorConstruction>(otherIndex, otherVector)));

                        default:
                            throw new InvalidOperationException("Join/Zip - Invalid JoinKind value!");
                        }
                    }
                    return(new Tuple <IIndex <a>, VectorConstruction, VectorConstruction>(thisIndex, thisVector, otherVector));
                }
            }
            if ((lookup != Lookup.Exact ? 0 : (object.ReferenceEquals((object)restriction, (object)sourceIndex) ? 1 : 0)) != 0)
            {
                return((Tuple <IIndex <a>, VectorConstruction, VectorConstruction>) FSharpFunc <IIndex <a>, VectorConstruction> .InvokeFast <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> >((FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <M0, M1> > >) fsharpFunc1, restriction, vectorConstruction1, (M0)vector1));
            }
            Tuple <IIndex <a>, VectorConstruction> rowIndex = JoinHelpers.restrictToRowIndex <a>(lookup, restriction, sourceIndex, vector1);
            VectorConstruction vector2 = rowIndex.Item2;
            IIndex <a>         index2  = rowIndex.Item1;

            if ((lookup != Lookup.Exact ? 0 : (LanguagePrimitives.HashCompare.GenericEqualityIntrinsic <IIndex <a> >((M0)restriction, (M0)index2) ? 1 : 0)) != 0)
            {
                return((Tuple <IIndex <a>, VectorConstruction, VectorConstruction>) FSharpFunc <IIndex <a>, VectorConstruction> .InvokeFast <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> >((FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <M0, M1> > >) fsharpFunc1, restriction, vectorConstruction1, (M0)vector2));
            }
            VectorConstruction vectorConstruction4 = JoinHelpers.fillMissing(vector2, lookup);
            VectorConstruction vectorConstruction5 = otherIndexBuilder.Reindex <a>(index2, restriction, lookup, vectorConstruction4, (FSharpFunc <long, bool>) new JoinHelpers.otherRowCmd());

            return((Tuple <IIndex <a>, VectorConstruction, VectorConstruction>) FSharpFunc <IIndex <a>, VectorConstruction> .InvokeFast <VectorConstruction, Tuple <IIndex <a>, VectorConstruction, VectorConstruction> >((FSharpFunc <IIndex <a>, FSharpFunc <VectorConstruction, FSharpFunc <M0, M1> > >) fsharpFunc1, restriction, vectorConstruction1, (M0)vectorConstruction5));
        }