MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / getFunctions

Method getFunctions

test/compute-engine/compile-plugin.test.ts:74–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 }
73
74 getFunctions(): CompiledFunctions {
75 return {
76 Add: (args, compile) => args.map(compile).join(' ') + ' +',
77 Subtract: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' -',
78 Multiply: (args, compile) => args.map(compile).join(' ') + ' *',
79 Divide: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' /',
80 Power: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' **',
81 Sin: (args, compile) => compile(args[0]) + ' sin',
82 Cos: (args, compile) => compile(args[0]) + ' cos',
83 Sqrt: (args, compile) => compile(args[0]) + ' sqrt',
84 };
85 }
86
87 createTarget(options: Partial<CompileTarget> = {}): CompileTarget {
88 const fns = this.getFunctions();

Callers 1

createTargetMethod · 0.95

Calls 2

compileFunction · 0.90
mapMethod · 0.65

Tested by

no test coverage detected