486 references to Assert
Microsoft.ML.Core (486)
CommandLine\CharCursor.cs (1)
63Contracts.Assert(0 <= dich && dich <= _ichLim - _ichCur);
CommandLine\CmdLexer.cs (20)
80Contracts.Assert(bldr.Length > ichDst); 120Contracts.Assert(_curs.ChCur == '{'); 133Contracts.Assert(count > 0); 168Contracts.Assert(_curs.ChCur == '{'); 182Contracts.Assert(count >= 0); 215Contracts.Assert(_curs.ChCur == '\\'); 216Contracts.Assert(_escapes); 249Contracts.Assert(_curs.ChCur == '"'); 330Contracts.Assert(0 <= ich && ich <= sb.Length); 346Contracts.Assert(curs.IchCur > 0 || lex.Error); 381Contracts.Assert(f == (force || curs.ChCur == '{')); 390Contracts.Assert(v.StartsWith("{") && v.EndsWith("}")); 396Contracts.Assert(!lex.Error); 397Contracts.Assert(curs.Eof); 398Contracts.Assert(str == res.ToString()); 415Contracts.Assert(ich == sb.Length); 420Contracts.Assert(ich == sb.Length); 444Contracts.Assert(curs.IchCur > 0 || lex.Error); 517Contracts.Assert(ichMin >= 0 && _str[ichMin] == '\\'); 518Contracts.Assert(ichMin == 0 || _str[ichMin - 1] != '\\');
CommandLine\CmdParser.cs (27)
454Contracts.Assert(1 < firstNonUpper && firstNonUpper <= name.Length); 496Contracts.Assert(!isDefault || nicks == null); 529Contracts.Assert(def.ShortNames == null); 531Contracts.Assert(map.ContainsKey(name) && map[name] == def); 568Contracts.Assert(!string.IsNullOrEmpty(str)); 622Contracts.Assert(arg != info.ArgDef); 623Contracts.Assert(0 <= arg.Index && arg.Index < info.Args.Length); 1037Contracts.Assert(ich < curs.IchCur || curs.Eof); 1090Contracts.Assert(ich < curs.IchCur || curs.Eof); 1205Contracts.Assert(Args.Where(a => a.Index == argument.Index).Count() == 1); 1269Contracts.Assert(isGeneric); 1271Contracts.Assert(Utils.Size(genArgs) == 1); 1341Contracts.Assert(argDef == null || argDef.Index == -1); 1344Contracts.Assert(map.Count >= args.Length); 1345Contracts.Assert(args.Select((arg, index) => arg.Index == index).All(b => b)); 1421Contracts.Assert(index >= -1); 1422Contracts.Assert(!string.IsNullOrWhiteSpace(name)); 1440Contracts.Assert(!IsDefault || Utils.Size(ShortNames) == 0); 1681Contracts.Assert(string.IsNullOrEmpty(tag) || tag.StartsWith("[") && tag.EndsWith("]")); 1708Contracts.Assert(newValue is string || newValue == null); 1709Contracts.Assert((string)newValue != ""); 1891Contracts.Assert(type.IsEnum); 1928Contracts.Assert(success); 1965Contracts.Assert(value == null || value is Array); 2032Contracts.Assert(IsKeyValuePair(type)); 2060Contracts.Assert(value == null || value is Array); 2237Contracts.Assert(false);
ComponentModel\ComponentCatalog.cs (6)
209Contracts.Assert(getter == null || Utils.Size(attr.CtorTypes) == 0); 231Contracts.Assert(ArgType == null || CtorTypes.Length > 0 && CtorTypes[0] == ArgType); 236Contracts.Assert(Utils.Size(ctorArgs) == CtorTypes.Length + ((RequireEnvironment) ? 1 : 0)); 241Contracts.Assert(Utils.Size(ctorArgs) == 0); 704Contracts.Assert(getter == null && ctor == null && create == null); 1067Contracts.Assert(false);
Data\ColumnTypeExtensions.cs (2)
135Contracts.Assert(false); 165Contracts.Assert(false);
Data\IFileHandle.cs (3)
99Contracts.Assert(_streams != null); 133Contracts.Assert(IsDisposed); 166Contracts.Assert(_streamWrite == null);
Data\ModelHeader.cs (10)
109Contracts.Assert(Marshal.SizeOf(typeof(ModelHeader)) == Size); 152Contracts.Assert(ns.Id == cv); 157Contracts.Assert(cv == pool.Count); 160Contracts.Assert(header.FpStringChars == header.FpStringTable + header.CbStringTable); 167Contracts.Assert(offset == header.CbStringChars); 210Contracts.Assert(res); 218Contracts.Assert(writer.FpCur() == fpMin + ModelHeader.Size); 503Contracts.Assert(reader.FpCur() == header.FpStringTable + fpMin); 506Contracts.Assert(cstr < int.MaxValue); 508Contracts.Assert(header.FpStringChars == reader.FpCur() - fpMin);
Data\ModelLoading.cs (2)
169Contracts.Assert(fp == ent.Stream.Position); 220Contracts.Assert(fp == ctx.FpMin);
Data\ProgressReporter.cs (7)
115Contracts.Assert(_subChannels.Count == 0); 133Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 161Contracts.Assert(res == channel); 233Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 242Contracts.Assert(level >= 0); 352Contracts.Assert(index > 0); 537Contracts.Assert(0 <= index && index < Progress.Length);
Data\ReadOnlyMemoryUtils.cs (1)
231Contracts.Assert(j == span.Length);
Data\RoleMappedSchema.cs (3)
166Contracts.Assert(Utils.Size(kvp.Value) > 0); 316Contracts.Assert(Utils.Size(kvp.Value) > 0); 426Contracts.Assert(schema.Schema == data.Schema);
Environment\ConsoleEnvironment.cs (10)
74Contracts.Assert(msg.Kind == ChannelMessageKind.Error); 126Contracts.Assert(commChannel.Verbose); 230Contracts.Assert(ev.Kind == ProgressReporting.ProgressEvent.EventKind.Progress); 231Contracts.Assert(!ev.ProgressEntry.IsCheckpoint); 399Contracts.Assert(source == this || source is Host); 406Contracts.Assert(parent is ConsoleEnvironment); 414Contracts.Assert(parent is ConsoleEnvironment); 457Contracts.Assert(_root._consoleWriter == _newConsoleWriter); 474Contracts.Assert(parent is Host); 482Contracts.Assert(parent is Host);
Environment\HostEnvironmentBase.cs (2)
479Contracts.Assert(dispatcher is Dispatcher<TMessage>); 564Contracts.Assert(ichMin <= ichLim);
Utilities\BigArray.cs (45)
104Contracts.Assert(longBlockCount <= Utils.ArrayMaxSize); 107Contracts.Assert(blockCount > 0); 108Contracts.Assert(0 < lastBlockSize && lastBlockSize <= BlockSize); 157Contracts.Assert(index == lim); 192Contracts.Assert(index == lim); 226Contracts.Assert(0 < longBlockCount && longBlockCount <= Utils.ArrayMaxSize); 229Contracts.Assert(0 < newLastBlockLength && newLastBlockLength <= BlockSize); 243Contracts.Assert(curBlockCount > 0); 246Contracts.Assert(0 < curLastBlockLength && curLastBlockLength <= curLastBlockSize && curLastBlockSize <= BlockSize); 251Contracts.Assert(newBlockCount < curBlockCount || (newBlockCount == curBlockCount && newLastBlockLength < curLastBlockLength)); 259Contracts.Assert(curBlockCount == newBlockCount); 264Contracts.Assert(_length == curLastBlockLength); 265Contracts.Assert(newLength == newLastBlockLength); 266Contracts.Assert(_entries.Length == 1); 279Contracts.Assert(newBlockCount > curBlockCount); 296Contracts.Assert(Utils.Size(_entries) == 0); 303Contracts.Assert(maMax >= 0); 304Contracts.Assert(0 < miLim && miLim <= Utils.Size(_entries[maMax])); 331Contracts.Assert(maMin <= maMax); // Could be violated if length == 0, but we already took care of this. 337Contracts.Assert(miLim - miMin == src.Length); 343Contracts.Assert((BlockSize - miMin) + miLim == src.Length); 347Contracts.Assert(_entries[maMax] == null); 362Contracts.Assert(_entries[major] == null); 366Contracts.Assert(srcSoFar < src.Length); 369Contracts.Assert(src.Length - srcSoFar == miLim); 370Contracts.Assert(_entries[maMax] == null); 389Contracts.Assert(0 <= length && length <= dst.Length); 390Contracts.Assert(idx <= Length && length <= Length - idx); 401Contracts.Assert(maMin <= maMax); // Could happen if length == 0, but we already took care of this. 406Contracts.Assert(miLim - miMin == length); 407Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); 412Contracts.Assert((BlockSize - miMin) + miLim == length); 413Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); 415Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); 423Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); 429Contracts.Assert(BlockSize <= Utils.Size(_entries[major])); 432Contracts.Assert(dstSoFar < length); 435Contracts.Assert(length - dstSoFar == miLim); 436Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); 444Contracts.Assert(min >= 0); 445Contracts.Assert((min >> BlockSizeBits) < int.MaxValue); 448Contracts.Assert((long)major * BlockSize + minor == min); 453Contracts.Assert(lim > 0); 454Contracts.Assert((lim >> BlockSizeBits) < int.MaxValue); 458Contracts.Assert((long)major * BlockSize + minor == lim + 1);
Utilities\BinFinder.cs (52)
51Contracts.Assert(numValues == values.Count + 1); 88Contracts.Assert(_path[0] == 0); 89Contracts.Assert(_path[CountBins] == CountValues); 99Contracts.Assert(bounds[i] > bounds[i - 1]); 129Contracts.Assert(numValues == values.Count + 1); 166Contracts.Assert(_path[0] == 0); 167Contracts.Assert(_path[CountBins] == CountValues); 177Contracts.Assert(bounds[i] > bounds[i - 1]); 203Contracts.Assert(path[0] == 0); 204Contracts.Assert(path[CountBins] == CountValues); 216Contracts.Assert(a < b); 232Contracts.Assert(a <= ave); 245Contracts.Assert(a < b); 261Contracts.Assert(a <= ave); 331Contracts.Assert(CountValues > CountBins); 332Contracts.Assert(counts.Count == CountValues); 333Contracts.Assert(path.Length >= CountBins + 1); 362Contracts.Assert(_segmentHeap.Count > 0); 373Contracts.Assert(_path[0] == 0); 374Contracts.Assert(_path[CountBins] == CountValues); 391Contracts.Assert(min < max - 1); 434Contracts.Assert(0 <= min && min < split && split < max && max <= CountValues); 442Contracts.Assert(a < b && b < c); 482Contracts.Assert(peg.Energy >= 0); 491Contracts.Assert(pegs[peg.Index] == peg); 492Contracts.Assert(_path[peg.Index] != peg.Split); 495Contracts.Assert(FindSplitPosition(out e, _path[peg.Index - 1], _path[peg.Index + 1], peg.Index) == peg.Split); 520Contracts.Assert(peg.Energy >= 0); 568Contracts.Assert(CountBins >= 2); 569Contracts.Assert(CountValues > CountBins); 570Contracts.Assert(counts.Count == CountValues); 571Contracts.Assert(path.Length >= CountBins + 1); 611Contracts.Assert(bestWorst < EnergyType.MaxValue); 618Contracts.Assert(ccol > 0); 628Contracts.Assert(ivBase == (row - 1) * width); 651Contracts.Assert(eBest > 0); 652Contracts.Assert(0 <= colBest && colBest <= col); 665Contracts.Assert(bestWorst < EnergyType.MaxValue); 673Contracts.Assert(ccol > 0); 677Contracts.Assert(height + width == CountValues); 691Contracts.Assert(eBest < EnergyType.MaxValue); 695Contracts.Assert(height == CountBins - 1); 704Contracts.Assert(ivBase == (row - 1) * width); 706Contracts.Assert(_pathInfo[ivBase + colBest] <= colBest); 709Contracts.Assert(_path[row] < _path[row + 1]); 711Contracts.Assert(ivBase == 0); 716Contracts.Assert(d > 0); 730Contracts.Assert(0 <= row && row < CountBins - 1); 731Contracts.Assert(0 <= col && col <= _cskip); 738Contracts.Assert(0 < cbin && cbin <= span); 744Contracts.Assert(0 <= rem && rem < cbin); 755Contracts.Assert(worst >= best);
Utilities\DoubleParser.cs (34)
94Contracts.Assert(res != Result.Empty || ((flags & OptionFlags.EmptyAsNaN) == 0 && value == 0) || Single.IsNaN(value)); 104Contracts.Assert(res != Result.Empty || ((flags & OptionFlags.EmptyAsNaN) == 0 && value == 0) || Double.IsNaN(value)); 340Contracts.Assert((long)(Double)(long)num == (long)num); 360Contracts.Assert((long)(Double)(long)num == (long)num); 390Contracts.Assert((num & TopTwoBits) != 0); 391Contracts.Assert((mul & TopBit) != 0); 413Contracts.Assert((num & TopThreeBits) != 0); 433Contracts.Assert(exp > 0); 440Contracts.Assert(exp < 0); 444Contracts.Assert(e2 > 0); 448Contracts.Assert(0 < e2 && e2 < 0x7FF); 551Contracts.Assert(0 <= ich && ich <= span.Length); 552Contracts.Assert(!neg); 553Contracts.Assert(num == 0); 554Contracts.Assert(exp == 0); 616Contracts.Assert(i < span.Length); 632Contracts.Assert(i < span.Length); 638Contracts.Assert(i < span.Length); 639Contracts.Assert(span[i] == decimalMarker); 651Contracts.Assert(i < span.Length); 664Contracts.Assert(i < span.Length); 686Contracts.Assert(i < span.Length); 705Contracts.Assert(Math.Abs(exp) < int.MaxValue); 711Contracts.Assert(i < span.Length); 934Contracts.Assert(_mpe10Man.Length == _mpe10e2.Length); 935Contracts.Assert(_mpne10Man.Length == _mpne10ne2.Length); 939Contracts.Assert(_mpe10Dbl.Length <= _mpe10Man.Length); 952Contracts.Assert(0 < e2 && e2 < 0x7FF); 957Contracts.Assert((Single)_mpe10Dbl[_mpe10Dbl.Length - 1] == Single.PositiveInfinity); 958Contracts.Assert((Single)_mpe10Dbl[_mpe10Dbl.Length - 2] < Single.PositiveInfinity); 963Contracts.Assert(_mpne10Dbl.Length <= _mpne10Man.Length); 968Contracts.Assert(0 < e2 && e2 < 0x7FF); 975Contracts.Assert((Single)(_mpne10Dbl[_mpne10Dbl.Length - 1] * two64) == 0); 976Contracts.Assert((Single)(_mpne10Dbl[_mpne10Dbl.Length - 2] * two64) > 0);
Utilities\FixedSizeQueue.cs (4)
33Contracts.Assert(Utils.Size(_array) >= 0); 34Contracts.Assert(0 <= _startIndex && _startIndex < _array.Length); 35Contracts.Assert(0 <= _count && _count <= _array.Length); 70Contracts.Assert(index >= 0 && index < _count);
Utilities\FloatUtils.cs (8)
65Contracts.Assert(-RawExpZero < exp && exp < RawExpInf - RawExpZero); 109Contracts.Assert((man & ~MaskMan) == MaskMan + 1); 132Contracts.Assert(Bits != 0); 159Contracts.Assert(IsFiniteNormal()); 258Contracts.Assert(-RawExpZero < exp && exp < RawExpInf - RawExpZero); 302Contracts.Assert((man & ~MaskMan) == MaskMan + 1); 325Contracts.Assert(Bits != 0); 352Contracts.Assert(IsFiniteNormal());
Utilities\HashArray.cs (14)
65Contracts.Assert(0 <= _ct && _ct <= Utils.Size(_entries)); 69Contracts.Assert(Utils.Size(_rgit) >= _ct || Utils.Size(_rgit) == HashHelpers.MaxPrimeArrayLength); 79Contracts.Assert(0 <= it && it < _ct); 91Contracts.Assert(val != null); 100Contracts.Assert(0 <= iit && iit < _rgit.Length); 104Contracts.Assert(it < _ct); 110Contracts.Assert(it == -1); 150Contracts.Assert(val != null); 151Contracts.Assert(0 <= iit && iit < _rgit.Length); 155Contracts.Assert(_ct == Utils.Size(_entries)); 158Contracts.Assert(_ct < _entries.Length); 178Contracts.Assert(size >= _rgit.Length); 262Contracts.Assert(0 <= min && min < MaxPrimeArrayLength); 271Contracts.Assert(false);
Utilities\Hashing.cs (23)
128Contracts.Assert((bits & 0x7) == 0); 129Contracts.Assert((uint)bits <= 24); 130Contracts.Assert(cur <= 0x00FFFFFF); 145Contracts.Assert(ch <= 0xFFFF); 158Contracts.Assert((bits & 0x7) == 0); 159Contracts.Assert((uint)bits <= 24); 160Contracts.Assert(cur <= 0x00FFFFFF); 194Contracts.Assert((bits & 0x7) == 0); 195Contracts.Assert((uint)bits <= 24); 196Contracts.Assert(cur <= 0x00FFFFFF); 218Contracts.Assert(ch <= 0x10FFFF); 232Contracts.Assert((bits & 0x7) == 0); 233Contracts.Assert((uint)bits <= 24); 234Contracts.Assert(cur <= 0x00FFFFFF); 277Contracts.Assert(0 <= ichMin && ichMin <= ichLim && ichLim <= Utils.Size(data)); 289Contracts.Assert((bits & 0x7) == 0); 290Contracts.Assert((uint)bits <= 24); 291Contracts.Assert(cur <= 0x00FFFFFF); 306Contracts.Assert(ch <= 0xFFFF); 319Contracts.Assert((bits & 0x7) == 0); 320Contracts.Assert((uint)bits <= 24); 321Contracts.Assert(cur <= 0x00FFFFFF); 335Contracts.Assert(hash == MurmurHash(seed, data.ToString().AsSpan()));
Utilities\Heap.cs (16)
47Contracts.Assert(capacity >= 0); 61Contracts.Assert(_rgv.Count > 0); 103Contracts.Assert(iv > 0); 170Contracts.Assert(0 < iv && iv < _rgv.Count); 181Contracts.Assert(0 < iv && iv < _rgv.Count); 208Contracts.Assert(!InHeap); 247Contracts.Assert(capacity >= 0); 261Contracts.Assert(_rgv.Count > 0); 303Contracts.Assert(iv > 0); 311Contracts.Assert(0 < index && index < _rgv.Count); 313Contracts.Assert(result._index == index); 368Contracts.Assert(!vRes.InHeap); 404Contracts.Assert(ivSrc >= ivDst); 416Contracts.Assert(!item.InHeap); 421Contracts.Assert(0 < iv && iv < _rgv.Count); 432Contracts.Assert(0 < iv && iv < _rgv.Count);
Utilities\HybridMemoryStream.cs (5)
100Contracts.Assert(_memStream == null); 101Contracts.Assert(_overflowStream == null); 105Contracts.Assert((_memStream == null) != (_overflowStream == null)); 106Contracts.Assert(Length <= _overflowBoundary || _overflowStream != null); 159Contracts.Assert(_memStream != null);
Utilities\LruCache.cs (2)
47Contracts.Assert(key.GetHashCode() == node.Value.Key.GetHashCode()); 64Contracts.Assert(!_cache.ContainsKey(key));
Utilities\MathUtils.cs (27)
285Contracts.Assert(FloatUtils.IsFinite(maxRelErr)); 286Contracts.Assert(FloatUtils.IsFinite(maxAbsError)); 407Contracts.Assert(tol > 0); 436Contracts.Assert(0 <= x && x <= 1); 437Contracts.Assert(0 < a); 438Contracts.Assert(0 < b); 545Contracts.Assert(0 <= exp && exp < ExpInf); 572Contracts.Assert(0 <= n && n < ExpInf); 574Contracts.Assert(0 <= f && f < 1); 578Contracts.Assert(1 <= r && r < float.PositiveInfinity); 611Contracts.Assert(0 <= n && n < ExpInf); 613Contracts.Assert(0 <= f && f < 1); 617Contracts.Assert(1 <= r && r < float.PositiveInfinity); 651Contracts.Assert(0 <= n && n < ExpInf); 653Contracts.Assert(0 <= f && f < 1); 657Contracts.Assert(1 <= r && r < float.PositiveInfinity); 673Contracts.Assert(src.Length == dst.Length); 682Contracts.Assert(src.Length == dst.Length); 683Contracts.Assert(0 <= start && start <= end && end <= src.Length); 705Contracts.Assert(count >= 0); 706Contracts.Assert(Utils.Size(src) >= count); 718Contracts.Assert(ivMin <= ivLim); 724Contracts.Assert(!float.IsNaN(src[ivLim - 1])); 738Contracts.Assert(len > 0); 739Contracts.Assert(aIdx >= 0 && aIdx <= a.Length - len); 740Contracts.Assert(bIdx >= 0 && bIdx <= b.Length - len); 754Contracts.Assert(-1 - epsilon <= similarity && similarity <= 1 + epsilon);
Utilities\MatrixTransposeOps.cs (4)
34Contracts.Assert(src.Length <= m * n); 35Contracts.Assert(dst.Length <= m * n); 85Contracts.Assert(src.Length <= m * n); 86Contracts.Assert(dst.Length <= m * n);
Utilities\MinWaiter.cs (4)
80Contracts.Assert(_waiters.Count < _maxWaiters); 85Contracts.Assert(_waiters.Count < _maxWaiters); 103Contracts.Assert(_waiters.Count < _maxWaiters); 106Contracts.Assert(_maxWaiters == 0 || _waiters.Count < _maxWaiters);
Utilities\NormStr.cs (15)
31Contracts.Assert(id >= 0 || id == -1 && str.IsEmpty); 73Contracts.Assert(_rgins.Length == _mask + 1); 74Contracts.Assert(Utils.IsPowerOfTwo(_mask + 1)); 76Contracts.Assert(0 <= _cns && _cns <= Utils.Size(_rgns)); 77Contracts.Assert(Utils.Size(_rgns) == Utils.Size(_rgmeta)); 114Contracts.Assert(ins == -1); 137Contracts.Assert(ins == -1); 196Contracts.Assert(ins == -1); 214Contracts.Assert(str.Length >= 0); 215Contracts.Assert(Hashing.HashString(str.Span) == hash); 219Contracts.Assert(_cns == 0); 225Contracts.Assert(_cns == _rgns.Length); 230Contracts.Assert(_cns < _rgns.Length); 253Contracts.Assert(0 <= ins && ins < _cns); 254Contracts.Assert(_rgns[ins].Id == ins);
Utilities\Random.cs (3)
182Contracts.Assert(n >= 0); 193Contracts.Assert(0 <= res && (res < maxValue || res == 0)); 233Contracts.Assert((uint)(float)u == u);
Utilities\ReservoirSampler.cs (1)
195Contracts.Assert(_counts.Contains(0));
Utilities\Stream.cs (19)
149Contracts.Assert(0 <= count && count <= Utils.Size(values)); 162Contracts.Assert(0 <= count && count <= Utils.Size(values)); 191Contracts.Assert(cv < count); 195Contracts.Assert(cv == count); 479Contracts.Assert(size >= 0); 509Contracts.Assert(0 <= start && start < array.Length); 510Contracts.Assert(0 < count && count <= array.Length - start); 543Contracts.Assert(size >= 0); 580Contracts.Assert(size >= 0); 617Contracts.Assert(size >= 0); 655Contracts.Assert(size >= 0); 693Contracts.Assert(size >= 0); 731Contracts.Assert(size >= 0); 775Contracts.Assert(size >= 0); 813Contracts.Assert(size >= 0); 838Contracts.Assert(bytesToRead >= 0); 839Contracts.Assert(destinationSizeInBytes >= bytesToRead); 840Contracts.Assert(destination != null); 859Contracts.Assert(offset == bytesToRead);
Utilities\SubsetStream.cs (1)
44Contracts.Assert(!length.HasValue || length >= 0);
Utilities\SupervisedBinFinder.cs (16)
69Contracts.Assert(_valueCount == labels.Count); 88Contracts.Assert(pair.Value >= curValue); 104Contracts.Assert(curIndex == _distinctValueCount - 1); 107Contracts.Assert(Utils.Size(boundaries) > 0); 109Contracts.Assert(boundaries[boundaries.Length - 1] == _distinctValueCount); 122Contracts.Assert(FloatUtils.IsFinite(result[i])); 147Contracts.Assert(_valueCount == labels.Count); 166Contracts.Assert(pair.Value >= curValue); 182Contracts.Assert(curIndex == _distinctValueCount - 1); 185Contracts.Assert(Utils.Size(boundaries) > 0); 187Contracts.Assert(boundaries[boundaries.Length - 1] == _distinctValueCount); 200Contracts.Assert(FloatUtils.IsFinite(result[i])); 214Contracts.Assert(result[i] > result[i - 1]); 223Contracts.Assert(result[i] > result[i - 1]); 259Contracts.Assert(leftCount + rightCount == totalCount); 337Contracts.Assert(intervals.Count == 0);
Utilities\TextReaderStream.cs (10)
111Contracts.Assert(_buffCur == _buffLim); 116Contracts.Assert(_lineCur == 0); 125Contracts.Assert(_lineCur <= _line.Length); 134Contracts.Assert(0 < _buffLim && _buffLim <= _buff.Length); 141Contracts.Assert(charCount > 0); 143Contracts.Assert(0 < _buffLim && _buffLim <= _buff.Length); 145Contracts.Assert(_lineCur <= _line.Length); 159Contracts.Assert(_buffCur < _buffLim); 161Contracts.Assert(toCopy > 0); 174Contracts.Assert(_eof || _buffCur < _buffLim);
Utilities\Tree.cs (2)
146Contracts.Assert(!ContainsKey(key)); 164Contracts.Assert(_parent._children.ContainsKey(Key));
Utilities\Utils.cs (55)
189Contracts.Assert(src != null); 190Contracts.Assert(!count.HasValue || (0 <= count && count <= src.Count)); 191Contracts.Assert(src.Count <= dst.Length); 288Contracts.Assert(0 <= min && min <= lim && lim <= input.Count); 295Contracts.Assert(minCur <= mid && mid < limCur); 302Contracts.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 303Contracts.Assert(minCur == min || input[minCur - 1] < value); 304Contracts.Assert(limCur == lim || input[limCur] >= value); 306Contracts.Assert(min <= minCur && minCur == limCur && limCur <= lim); 307Contracts.Assert(minCur == min || input[minCur - 1] < value); 308Contracts.Assert(limCur == lim || input[limCur] >= value); 322Contracts.Assert(0 <= min && min <= lim && lim <= input.Count); 323Contracts.Assert(!float.IsNaN(value)); 330Contracts.Assert(minCur <= mid && mid < limCur); 331Contracts.Assert(!float.IsNaN(input[mid])); 338Contracts.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 339Contracts.Assert(minCur == min || input[minCur - 1] < value); 340Contracts.Assert(limCur == lim || input[limCur] >= value); 342Contracts.Assert(min <= minCur && minCur == limCur && limCur <= lim); 343Contracts.Assert(minCur == min || input[minCur - 1] < value); 344Contracts.Assert(limCur == lim || input[limCur] >= value); 358Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 359Contracts.Assert(!Double.IsNaN(value)); 366Contracts.Assert(minCur <= mid && mid < limCur); 367Contracts.Assert(!Double.IsNaN(input[mid])); 374Contracts.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 375Contracts.Assert(minCur == min || input[minCur - 1] < value); 376Contracts.Assert(limCur == lim || input[limCur] >= value); 378Contracts.Assert(min <= minCur && minCur == limCur && limCur <= lim); 379Contracts.Assert(minCur == min || input[minCur - 1] < value); 380Contracts.Assert(limCur == lim || input[limCur] >= value); 393Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 400Contracts.Assert(minCur <= mid && mid < limCur); 407Contracts.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 408Contracts.Assert(minCur == min || !func(input[minCur - 1])); 409Contracts.Assert(limCur == lim || func(input[limCur])); 411Contracts.Assert(min <= minCur && minCur == limCur && limCur <= lim); 412Contracts.Assert(minCur == min || !func(input[minCur - 1])); 413Contracts.Assert(limCur == lim || func(input[limCur])); 426Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 433Contracts.Assert(minCur <= mid && mid < limCur); 440Contracts.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 441Contracts.Assert(minCur == min || !func(input[minCur - 1], value)); 442Contracts.Assert(limCur == lim || func(input[limCur], value)); 444Contracts.Assert(min <= minCur && minCur == limCur && limCur <= lim); 445Contracts.Assert(minCur == min || !func(input[minCur - 1], value)); 446Contracts.Assert(limCur == lim || func(input[limCur], value)); 453Contracts.Assert(size >= 0); 463Contracts.Assert(0 <= lim && lim <= a.Length); 494Contracts.Assert(0 <= j && j < perm.Length); 495Contracts.Assert(res[j] == 0 && (j != perm[0] || i == 0)); 504Contracts.Assert(size >= 0); 890Contracts.Assert(nn != null || size == 0); 891Contracts.Assert((ne == null) == (size == 0)); 910Contracts.Assert(ivDst == size);
Utilities\VBufferUtils.cs (32)
370Contracts.Assert(i <= indices[i]); 423Contracts.Assert(lim < denseCount); 480Contracts.Assert(j < sparseCount); 487Contracts.Assert(j == sparseCount); 718Contracts.Assert(newCount > 0); 719Contracts.Assert(0 < srcValues.Length && srcValues.Length <= newCount); 720Contracts.Assert(0 < dstValues.Length && dstValues.Length <= newCount); 779Contracts.Assert(sIndex >= 0); 780Contracts.Assert(sIndex == dIndex); 797Contracts.Assert(srcValues.Length == dstValues.Length); 800Contracts.Assert(srcIndices[i] == dstIndices[i]); 806Contracts.Assert(newCount > srcValues.Length); 830Contracts.Assert(dstIndices[dI] == sIndex); 850Contracts.Assert(srcIndices[sI] == bIndex); 867Contracts.Assert(false); 894Contracts.Assert(srcValues.Length == src.Length); 904Contracts.Assert(0 < count && count < length); 938Contracts.Assert(srcValues.Length == src.Length); 947Contracts.Assert(0 < count && count < length); 988Contracts.Assert(dstCount > 0); 1032Contracts.Assert(srcValues.Length > 0); 1053Contracts.Assert(0 < resCount && resCount <= length); 1054Contracts.Assert(resCount <= srcValues.Length + dstCount); 1055Contracts.Assert(srcValues.Length <= resCount); 1056Contracts.Assert(dstCount <= resCount); 1077Contracts.Assert(i < length || j < length); 1107Contracts.Assert(ii == srcValues.Length && jj == dstCount); 1108Contracts.Assert(i == length && j == length); 1264Contracts.Assert(aIndices[aI] == bIndices[aI]); 1275Contracts.Assert(aIndices[aI] >= bIndices[bI]); 1290Contracts.Assert(bIndices[bI] >= aIndices[aI]); 1323Contracts.Assert(index == bIndices[bI]);