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

Function eqRank

src/compute-engine/boxed-expression/order.ts:129–133  ·  view source on GitHub ↗
(x: Expression)

Source from the content-addressed store, hash-verified

127}
128
129/**
130 * Sort terms of a sum with `addOrder` semantics, computing each term's
131 * degree/lexicographic keys once instead of on every comparison (`addOrder`
132 * re-walks both expressions per comparison — O(n log n) walks per sort).
133 * The comparator chain below returns exactly the values `addOrder` would,
134 * and `Array.sort` is stable, so the result order is identical.
135 */
136export function sortAddTerms(

Callers 1

equalOrderFunction · 0.85

Calls 2

isSymbolFunction · 0.90
isNumberFunction · 0.90

Tested by

no test coverage detected