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

Method getFunctions

examples/compile-plugin-architecture.js:146–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 }
145
146 getFunctions() {
147 return {
148 Add: (args, compile) => args.map(compile).join(' ') + ' +',
149 Subtract: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' -',
150 Multiply: (args, compile) => args.map(compile).join(' ') + ' *',
151 Divide: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' /',
152 Power: (args, compile) => compile(args[0]) + ' ' + compile(args[1]) + ' ^',
153 Sin: (args, compile) => compile(args[0]) + ' sin',
154 Cos: (args, compile) => compile(args[0]) + ' cos',
155 Sqrt: (args, compile) => compile(args[0]) + ' sqrt',
156 };
157 }
158
159 createTarget(options = {}) {
160 const fns = this.getFunctions();

Callers 1

createTargetMethod · 0.95

Calls 2

compileFunction · 0.90
mapMethod · 0.65

Tested by

no test coverage detected