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

Function monoClassesX

src/compute-engine/rubi/rubi-utils.ts:1598–1613  ·  view source on GitHub ↗

group the structural sum terms of u into (exponent → summed coefficient) * classes; null when some term is not a structural monomial in x

(
  u: Expression,
  x: string
)

Source from the content-addressed store, hash-verified

1596 const ops = u.ops;
1597 if (!ops) return null;
1598 switch (u.operator) {
1599 case 'Power': {
1600 if (ops[1].has(x)) return null;
1601 if (ops[0].symbol === x) return { coef: ce.One, exp: ops[1] };
1602 const k = realNum(ops[1]);
1603 if (k !== null && Number.isInteger(k)) {
1604 const m = monoPartsX(ops[0], x);
1605 if (m !== null)
1606 return {
1607 coef: m.coef.pow(k).evaluate(),
1608 exp: m.exp.mul(k).evaluate(),
1609 };
1610 }
1611 return null;
1612 }
1613 case 'Sqrt':
1614 if (ops[0].symbol === x)
1615 return { coef: ce.One, exp: ce.expr(['Rational', 1, 2]) };
1616 return null;

Callers 7

genBinomialPartsXFunction · 0.85
genTrinomialPartsXFunction · 0.85
binomialMatchQFunction · 0.85
quadraticMatchQFunction · 0.85
trinomialMatchQFunction · 0.85
genBinomialMatchQFunction · 0.85
genTrinomialMatchQFunction · 0.85

Calls 8

sumTermsXFunction · 0.85
monoPartsXFunction · 0.85
zeroQFunction · 0.85
findMethod · 0.80
isSameMethod · 0.65
subMethod · 0.65
evaluateMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected