/** ****************************************************************************** * Copyright (C) 2018 Red Hat, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the Eclipse * Public License v. 2.0 are satisfied: GNU General Public License, version 2 * with the GNU Classpath Exception which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ export declare const enum Constants { /** * MAX SMI (SMall Integer) as defined in v8. * one bit is lost for boxing/unboxing flag. * one bit is lost for sign flag. * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values */ MAX_SAFE_SMALL_INTEGER = 1073741824, /** * MIN SMI (SMall Integer) as defined in v8. * one bit is lost for boxing/unboxing flag. * one bit is lost for sign flag. * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values */ MIN_SAFE_SMALL_INTEGER = -1073741824, /** * Max unsigned integer that fits on 8 bits. */ MAX_UINT_8 = 255,// 2^8 - 1 /** * Max unsigned integer that fits on 16 bits. */ MAX_UINT_16 = 65535,// 2^16 - 1 /** * Max unsigned integer that fits on 32 bits. */ MAX_UINT_32 = 4294967295 } export declare function toUint32(v: number): number; export declare class PrefixSumIndexOfResult { _prefixSumIndexOfResultBrand: void; index: number; remainder: number; constructor(index: number, remainder: number); } export declare class PrefixSumComputer { /** * values[i] is the value at index i */ private values; /** * prefixSum[i] = SUM(heights[j]), 0 <= j <= i */ private prefixSum; /** * prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted */ private readonly prefixSumValidIndex; constructor(values: Uint32Array); getCount(): number; insertValues(insertIndex: number, insertValues: Uint32Array): boolean; changeValue(index: number, value: number): boolean; removeValues(startIndex: number, cnt: number): boolean; getTotalValue(): number; getAccumulatedValue(index: number): number; private _getAccumulatedValue; getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult; } export declare class PrefixSumComputerWithCache { private readonly _actual; private _cacheAccumulatedValueStart; private _cache; constructor(values: Uint32Array); private _bustCache; insertValues(insertIndex: number, insertValues: Uint32Array): void; changeValue(index: number, value: number): void; removeValues(startIndex: number, cnt: number): void; getTotalValue(): number; getAccumulatedValue(index: number): number; getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult; /** * Gives a hint that a lot of requests are about to come in for these accumulated values. */ warmUpCache(accumulatedValueStart: number, accumulatedValueEnd: number): void; } //# sourceMappingURL=prefixSumComputer.d.ts.map