Data\DataViewUtils.cs (17)
128host.Check(Utils.Size(inputs) > 0);
225if (Utils.Size(cursors) == 0)
343Utils.BuildSubsetMaps(schema, cursor.IsColumnActive, out activeToCol, out colToActive);
348if (Utils.Size(ourPools) != schema.Count)
376workers[t] = Utils.RunOnBackgroundThreadAsync(() =>
485return Utils.MarshalInvoke(_getPoolCoreMethodInfo, type.RawType, pools, poolIdx);
524Utils.BuildSubsetMaps(_schema, input.IsColumnActive, out activeToCol, out colToActive);
542Utils.MarshalInvoke(_createInPipeMethodInfo, this, column.Type.RawType, input, activeToCol[c]);
560Task thread = Utils.RunOnBackgroundThreadAsync(
721Utils.EnsureSize(ref _values, Count + 1, keepOld: true);
765Contracts.Assert(Utils.Size(values) >= count);
833Contracts.Assert(Utils.Size(pipes) == _batchColumns.Length);
939Contracts.Assert(_count <= Utils.Size(Values));
1189Utils.BuildSubsetMaps(_schema, _cursors[0].IsColumnActive, out _activeToCol, out _colToActive);
1244return Utils.MarshalInvoke(_createGetterMethodInfo, this, Schema[col].Type.RawType, col);
1341getter = Utils.MarshalInvoke(GetVectorFlatteningGetter<int>, vectorType.ItemType.RawType,
1346getter = Utils.MarshalInvoke(GetSingleValueGetter<int>, colType.RawType,
Data\RowCursorUtils.cs (4)
39return Utils.MarshalInvoke(_getGetterAsDelegateCoreMethodInfo, row.Schema[col].Type.RawType, row, col);
129return Utils.MarshalInvoke(GetGetterAsStringBuilderCore<int>, typeSrc.RawType, typeSrc, row, col);
310return Utils.MarshalInvoke(_getIsNewGroupDelegateCoreMethodInfo, type.RawType, cursor, col);
528bool[] active = Utils.BuildArray(Schema.Count, columnNeeded);
DataLoadSave\Text\TextLoaderParser.cs (7)
81return Utils.MarshalInvoke(_getCreatorOneCoreMethodInfo, this, type.RawType, type);
94return Utils.MarshalInvoke(_getCreatorVecCoreMethodInfo, this, type.RawType, type);
108return Utils.MarshalInvoke(_getCreatorOneCoreMethodInfo, this, key.RawType, key);
114return Utils.MarshalInvoke(_getCreatorVecCoreMethodInfo, this, key.RawType, key);
865Contracts.Assert(active == null || Utils.Size(active) == _infos.Length);
1367Contracts.Assert(active == null || Utils.Size(active) == _infos.Length);
1460Contracts.Assert(Utils.Size(info.Segments) == 1);
DataView\CacheDataView.cs (26)
95if (_rowCount > Utils.ArrayMaxSize)
96throw _host.Except("The input data view has too many ({0}) rows. CacheDataView can only cache up to {1} rows", _rowCount, Utils.ArrayMaxSize);
102if (Utils.Size(prefetch) > 0)
145Utils.Add(ref columnsToDrop, c);
157prefetch[ip++] -= Utils.Size(columnsToDrop);
159inputToSubset[c] = c - Utils.Size(columnsToDrop);
164if (Utils.Size(columnsToDrop) == 0)
238if (rc > Utils.ArrayMaxSize)
240return Utils.GetRandomPermutation(rand, (int)_rowCount);
341Utils.Add(ref taskColumns, c);
345if (Utils.Size(taskColumns) == 0 && _cacheDefaultWaiter != null)
353caches = new ColumnCache[Utils.Size(taskColumns)];
367var fillerThread = Utils.RunOnBackgroundThreadAsync(() => Filler(cursor, caches, waiter));
402if (rowCount > Utils.ArrayMaxSize)
403throw _host.Except("The input data view has too many ({0}) rows. CacheDataView can only cache up to {1} rows", rowCount, Utils.ArrayMaxSize);
417if (_rowCount > Utils.ArrayMaxSize)
418throw _host.Except("The input data view has too many ({0}) rows. CacheDataView can only cache up to {1} rows", _rowCount, Utils.ArrayMaxSize);
1165Utils.BuildSubsetMaps(colLim, predicate, out actives, out _colToActivesIndex);
1221return Utils.MarshalInvoke(_createGetterDelegateMethodInfo, this, Schema[col].Type.RawType, col);
1372Utils.EnsureSize(ref _indexBoundaries, rowCount + 1);
1373Utils.EnsureSize(ref _valueBoundaries, rowCount + 1);
1379Utils.EnsureSize(ref _lengths, rowCount);
1388Ctx.Assert((idx + 1) < Utils.Size(_indexBoundaries));
1389Ctx.Assert((idx + 1) < Utils.Size(_valueBoundaries));
1390Ctx.Assert(_uniformLength > 0 || idx < Utils.Size(_lengths));
1443Utils.EnsureSize(ref _values, _rowCount + 1);
DataView\DataViewConstructionUtils.cs (11)
86var info = Utils.MarshalInvoke(_getAnnotationInfoMethodInfo, annotation.Type.RawType, annotation.Name, annotations);
290return Utils.MarshalInvoke(_createKeyGetterDelegateMethodInfo, this, keyRawType, peek, colType);
302return Utils.MarshalInvoke(del, this, genericType, peek);
316var n = Utils.Size(buf);
344var n = Utils.Size(buf);
643_permutation = Utils.GetRandomPermutation(rand, dataView._data.Count);
934return Utils.MarshalInvoke(_getArrayGetterMethodInfo, this, dstItemType) as ValueGetter<TDst>;
950return Utils.MarshalInvoke(_getVBufferGetterMethodInfo, this, annotationVectorType.ItemType.RawType) as ValueGetter<TDst>;
976return Utils.MarshalInvoke(_getGetterCoreMethodInfo, this, AnnotationType.RawType);
982var n = Utils.Size(value);
994var n = Utils.Size(value);
DataView\Transposer.cs (22)
90_host.CheckParam(Utils.Size(columns) > 0, nameof(columns), "Cannot be empty");
111_inputToTransposed = Utils.CreateArray(schema.Count, -1);
187if (rowCount > Utils.ArrayMaxSize)
188throw _host.ExceptParam(nameof(view), "View has {0} rows, we cannot transpose with more than {1}", rowCount, Utils.ArrayMaxSize);
207host.CheckParam(Utils.Size(columns) > 0, nameof(columns), "Cannot be empty");
250return Utils.MarshalInvoke(_getSlotCursorCoreMethodInfo, this, type, col);
399Utils.EnsureSize(ref indices, ++count);
401Utils.EnsureSize(ref values, count);
539Utils.EnsureSize(ref _indices, vecLen);
542Utils.EnsureSize(ref _values, vecLen);
545Utils.EnsureSize(ref _counts, vecLen, keepOld: false);
656Utils.EnsureSize(ref _cbuff, vecLen);
699Ch.Assert(0 <= _slotCurr && _slotCurr < Utils.Size(_cbuff) && _cbuff[_slotCurr].Buffer.Length == _len);
929return Utils.MarshalInvoke(_createCoreMethodInfo, type.RawType, view, col);
953Contracts.Assert(Utils.IsIncreasing(1, ends, vectorSize + 1));
954return Utils.MarshalInvoke(CreateCore<int>, type.GetItemType().RawType, view, col, ends);
1096Contracts.Assert(Utils.Size(lims) >= 2);
1100Contracts.Assert(Utils.IsIncreasing(0, lims, type.Size + 1));
1274Ch.Assert(Utils.Size(activeSplitters) == slicer._splitters.Length);
1377var getter = Utils.MarshalInvoke(_slotCursorGetGetterMethodInfo, cursor, genTypeArgs[0]) as ValueGetter<TValue>;
1399return Utils.MarshalInvoke(_getRowCursorShimCoreMethodInfo, cursor.GetSlotType().ItemType.RawType, provider, cursor);
1452return Utils.MarshalInvoke(_getRowCursorMethodInfo, this, _type.GetItemType().RawType, hasZero);
Deprecated\Vector\VectorUtils.cs (9)
25Contracts.Check(Utils.Size(a) == Utils.Size(b), "Arrays must have the same length");
26Contracts.Check(Utils.Size(a) > 0);
32Contracts.Check(Utils.Size(a) == b.Length, "Vectors must have the same dimensionality.");
270int aMin = Utils.FindIndexSorted(aIndices, 0, aIndices.Length, offset);
271int aLim = Utils.FindIndexSorted(aIndices, 0, aIndices.Length, offset + b.Length);
346ia = Utils.FindIndexSorted(aIndices, ia, iaLim, bIndices[ib]);
354ib = Utils.FindIndexSorted(bIndices, ib, ibLim, aIndices[ia]);
417Contracts.Check(Utils.Size(a) == b.Length, "Vectors must have the same dimensionality.");
EntryPoints\InputBuilder.cs (3)
463return Utils.MarshalInvoke(makeArray, type.GetElementType(), ectx, ja, attributes, catalog);
481return Utils.MarshalInvoke(makeDict, type.GetGenericArguments()[1], ectx, (JObject)value, attributes, catalog);
640return Utils.MarshalInvoke(creator, outerType.GetGenericArguments()[0], innerValue);
Evaluators\EvaluatorUtils.cs (11)
405return Utils.MarshalInvoke(AddTextColumn<int>, inputColType.RawType, env,
447return Utils.MarshalInvoke(AddKeyColumn<int>, inputColType.RawType, env,
512Contracts.Assert(src.Length == Utils.Size(map));
536Contracts.Assert(src.Length == Utils.Size(map));
613var keyValueMappers = Utils.MarshalInvoke(MapKeys<int>, keyValueType.RawType, views.Select(view => view.Schema).ToArray(), columnName, false, indices, keyNames);
681var keyValueMappers = Utils.MarshalInvoke(MapKeys<int>, keyValueType.RawType, views.Select(view => view.Schema).ToArray(), columnName, true, columnIndices, keyNames);
933idv = Utils.MarshalInvoke(AddVarLengthColumn<int>, vectorType.ItemType.RawType, env, idv,
996ch.Assert(Utils.Size(getters) == schema.Count);
997ch.Assert(Utils.Size(vBufferGetters) == schema.Count);
1065if (Utils.Size(nonAveragedCols) > 0)
1408var tempPerm = Utils.GetRandomPermutation(host.Rand, labelNames.Length);
Prediction\Calibrator.cs (10)
703getters[column.Index] = Utils.MarshalInvoke(_getPredictorGetterMethodInfo, this, type.RawType, predictorRow, column.Index);
785Host.CheckParam(Utils.Size(outputs) == 2, nameof(outputs), "Expected this to have two outputs");
794Host.CheckParam(Utils.Size(outputs) == 2, nameof(outputs), "Expected this to have two outputs");
1237_host.CheckDecode(Utils.Size(_binProbs) > 0);
1298_host.Check(Utils.Size(outputNames) == 2);
1414Utils.EnsureSize(ref _data, _itemsSeen, _capacity);
1796_host.Check(Utils.Size(scoreProbablityColumnNames) == 2);
1981_host.Assert(Utils.IsMonotonicallyIncreasing(mins));
1982_host.Assert(Utils.IsMonotonicallyIncreasing(maxes));
1983_host.Assert(Utils.IsMonotonicallyIncreasing(values));
Scorers\MulticlassClassificationScorer.cs (5)
145_getter = Utils.MarshalInvoke(_decodeInitMethodInfo, this, _type.ItemType.RawType, value);
187Utils.MarshalActionInvoke(SaveCore<int>, _type.ItemType.RawType, ctx);
235return Utils.MarshalInvoke(CreateBound<int>, _type.ItemType.RawType, env, (ISchemaBoundRowMapper)innerBound, _type, _getter, _metadataKind, _canWrap);
422return Utils.MarshalInvoke(WrapCore<int>, keyType.ItemType.RawType, env, mapper, trainSchema);
599Contracts.Assert(Utils.Size(mapperOutputs) == 1);
Transforms\ColumnConcatenatingTransformer.cs (6)
374env.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns));
377env.CheckUserArg(Utils.Size(options.Columns[i].Source) > 0, nameof(options.Columns));
394env.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns));
397env.CheckUserArg(Utils.Size(options.Columns[i].Source) > 0, nameof(options.Columns));
678return Utils.MarshalInvoke(_makeIdentityGetterMethodInfo, this, OutputType.RawType, input);
680return Utils.MarshalInvoke(_makeGetterMethodInfo, this, OutputType.ItemType.RawType, input);
Transforms\SlotsDroppingTransformer.cs (6)
299Host.CheckDecode(Utils.Size(SlotsMin[i]) > 0);
502=> (type is KeyDataViewType keytype && 0 < keytype.Count && keytype.Count < Utils.ArrayMaxSize)
745return Utils.MarshalInvoke(_makeOneTrivialGetterMethodInfo, this, _srcTypes[iinfo].RawType);
766return Utils.MarshalInvoke(_makeVecTrivialGetterMethodInfo, this, vectorType.ItemType.RawType);
787return Utils.MarshalInvoke(_makeVecGetterMethodInfo, this, vectorType.ItemType.RawType, input, iinfo);
821return Utils.MarshalInvoke(_getSrcGetterMethodInfo, this, typeDst.RawType, row, iinfo);
Transforms\ValueToKeyMappingTransformerImpl.cs (8)
57return Utils.MarshalInvoke(_createCoreMethodInfo, itemType.RawType, itemType, sorted);
124var perm = Utils.GetIdentityPermutation(_pool.Count);
297return Utils.MarshalInvoke(CreateVec<int>, bldr.ItemType.RawType, row, col, count, bldr);
298return Utils.MarshalInvoke(CreateOne<int>, bldr.ItemType.RawType, row, col, autoConvert, count, bldr);
536return Utils.MarshalInvoke(LoadCodecCore<int>, codec.Type.RawType, ctx, ectx, codec, count);
843return Utils.MarshalInvoke(CreateCore<int>, map.ItemType.RawType, host, schema, map, infos, textMetadata, iinfo);
1100TypedMap.ItemType.GetKeyCountAsInt32(_host) == 0 || !Utils.MarshalInvoke(_addMetadataCoreMethodInfo, this, srcMetaType.ItemType.RawType, srcMetaType.ItemType, builder))
1181TypedMap.ItemType.GetKeyCountAsInt32(_host) == 0 || !Utils.MarshalInvoke(_writeTextTermsCoreMethodInfo, this, srcMetaType.ItemType.RawType, srcMetaType.ItemType, writer))
Utils\ApiUtils.cs (4)
75return Utils.MarshalInvoke(_generatePeekFieldMethodInfo, typeof(TOwn), typeof(TRow), fieldType, fieldInfo, assignmentOpCode);
80return Utils.MarshalInvoke(_generatePeekPropertyMethodInfo, typeof(TOwn), typeof(TRow), propertyType, propertyInfo, assignmentOpCodeProp);
143return Utils.MarshalInvoke(_generatePokeFieldMethodInfo, typeof(TOwn), typeof(TRow), fieldType, fieldInfo, assignmentOpCode);
148return Utils.MarshalInvoke(_generatePokePropertyMethodInfo, typeof(TOwn), typeof(TRow), propertyType, propertyInfo);
Utils\SequencePool.cs (26)
53_buckets = Utils.CreateArray<int>(_mask + 1, -1);
73Contracts.CheckDecode(Utils.Size(_start) > 0 && _start[0] == 0);
78if (Utils.Size(_bytes) < 40)
82int ibit = Utils.IbitHigh((uint)Math.Max(_idLim, 31));
88_buckets = Utils.CreateArray<int>(_mask + 1, -1);
132Contracts.Assert(Utils.IsPowerOfTwo(_mask + 1));
134Contracts.Assert(0 <= _idLim && Math.Max(10, _idLim) <= Utils.Size(_start) - 1);
135Contracts.Assert(Math.Max(10, _idLim) <= Utils.Size(_hash));
136Contracts.Assert(Math.Max(10, _idLim) <= Utils.Size(_next));
138Contracts.Assert(0 <= _start[_idLim] && Math.Max(40, _start[_idLim]) <= Utils.Size(_bytes));
155Contracts.Assert(0 <= min && min <= lim && lim <= Utils.Size(sequence));
200Contracts.Check(0 <= min && min <= lim && lim <= Utils.Size(sequence));
221Contracts.Check(0 <= min && min <= lim && lim <= Utils.Size(sequence));
232Contracts.Assert(0 <= min && min <= lim && lim <= Utils.Size(sequence));
237Contracts.Check(_start.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool");
240int size = (newSize > Utils.ArrayMaxSize) ? Utils.ArrayMaxSize : (int)newSize;
247Contracts.Check(_next.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool");
250int size = (newSize > Utils.ArrayMaxSize) ? Utils.ArrayMaxSize : (int)newSize;
259Contracts.Check(_bytes.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool");
261int size = (newSize > Utils.ArrayMaxSize) ? Utils.ArrayMaxSize : (int)newSize;
286_buckets = Utils.CreateArray<int>(size, -1);
347Contracts.Assert(0 <= min && min <= lim && lim <= Utils.Size(bytes));
353if (Utils.Size(sequence) <= count)