UNPKG

lysergic

Version:

Synaptic's neural network compiler

39 lines (38 loc) 1.53 kB
import { Variable } from "./ast/nodes"; export interface IHeapOptions { } export interface Dictionary<T> { [key: string]: T; } export interface IBuildHeapOptions { minHeapSize?: number; buffer?: ArrayBuffer; } export declare class Heap { options: IHeapOptions; buffer: ArrayBuffer; memory: Float64Array; constructor(options?: IHeapOptions); allocationCount: number; private variables; private alloc(key, value, tag?); setVariable(key: string, value: number): Variable; setVariable(key: string, i: number, value: number): Variable; setVariable(key: string, i: number, j: number, value: number): Variable; setVariable(key: string, i: number, j: number, k: number, value: number): Variable; getVariable(key: string): Variable; getVariable(key: string, i: number): Variable; getVariable(key: string, i: number, j: number): Variable; getVariable(key: string, i: number, j: number, k: number): Variable; getValue(key: string): number; getValue(key: string, i: number): number; getValue(key: string, i: number, j: number): number; getValue(key: string, i: number, j: number, k: number): number; hasVariable(key: string): boolean; hasVariable(key: string, i: number): boolean; hasVariable(key: string, i: number, j: number): boolean; hasVariable(key: string, i: number, j: number, k: number): boolean; sortVariables(): void; build({minHeapSize, buffer}?: IBuildHeapOptions): Promise<void>; getVariables(): Variable[]; }