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

Function orderedTuple

src/compute-engine/boxed-expression/diophantine.ts:305–316  ·  view source on GitHub ↗

Place `X`/`Y` (Pell coordinates) into a caller-order tuple of arity `n`.

(
  ce: ComputeEngine,
  X: Expression,
  Y: Expression,
  xIdx: number,
  yIdx: number
)

Source from the content-addressed store, hash-verified

303 if (coef[j] === 0n) continue;
304 terms.push(ce.function('Multiply', [ce.number(coef[j]), params[j]]));
305 }
306 if (terms.length === 0) return ce.number(0);
307 if (terms.length === 1) return terms[0];
308 return ce.function('Add', terms);
309}
310
311//
312// ─── Exact confirmation & membership ────────────────────────────────────────
313//
314
315/** Substitute integer values and confirm the residual is exactly zero. */
316function confirm(
317 ce: ComputeEngine,
318 residual: Expression,
319 unknowns: string[],

Callers 1

parametricPellFunction · 0.85

Calls 1

tupleMethod · 0.65

Tested by

no test coverage detected