UNPKG

hyperformula-dc

Version:

HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas

75 lines (74 loc) 2.79 kB
/** * @license * Copyright (c) 2021 Handsoncode. All rights reserved. */ import { ArraySize } from '../../ArraySize'; import { ProcedureAst } from '../../parser'; import { Interpreter } from '../Interpreter'; import { InterpreterState } from '../InterpreterState'; import { InterpreterValue } from '../InterpreterValue'; import { ArgumentTypes, FunctionPlugin, FunctionPluginTypecheck } from './FunctionPlugin'; export declare type KernelRunShortcut = (...args: any[]) => number[][]; export declare type KernelFunction = ((this: KernelFunctionThis, ...args: any[]) => number); export interface KernelFunctionThis { thread: { x: number; y?: number; }; } export declare class MatrixPlugin extends FunctionPlugin implements FunctionPluginTypecheck<MatrixPlugin> { static implementedFunctions: { MMULT: { method: string; arraySizeMethod: string; parameters: { argumentType: ArgumentTypes; }[]; vectorizationForbidden: boolean; }; TRANSPOSE: { method: string; arraySizeMethod: string; parameters: { argumentType: ArgumentTypes; }[]; vectorizationForbidden: boolean; }; MAXPOOL: { method: string; arraySizeMethod: string; parameters: ({ argumentType: ArgumentTypes; optionalArg?: undefined; } | { argumentType: ArgumentTypes; optionalArg: boolean; })[]; vectorizationForbidden: boolean; }; MEDIANPOOL: { method: string; arraySizeMethod: string; parameters: ({ argumentType: ArgumentTypes; optionalArg?: undefined; } | { argumentType: ArgumentTypes; optionalArg: boolean; })[]; vectorizationForbidden: boolean; }; }; private readonly createKernel; constructor(interpreter: Interpreter); mmult(ast: ProcedureAst, state: InterpreterState): InterpreterValue; mmultArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; maxpool(ast: ProcedureAst, state: InterpreterState): InterpreterValue; medianpool(ast: ProcedureAst, state: InterpreterState): InterpreterValue; maxpoolArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; medianpoolArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; transpose(ast: ProcedureAst, state: InterpreterState): InterpreterValue; transposeArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; private createCpuKernel; private createGpuJsKernel; }