packages/solver/lib/simplifyExpression/collectAndCombineSearch/addLikeTerms.js
function addLikeTerms(node, polynomialOnly=false) {
  if (!Node.Type.isOperator(node)) {
    return Node.Status.noChange(node);
  }
  let status;

  if (!polynomialOnly) {
    status = evaluateConstantSum(node);
    if (status.hasChanged()) {
      return status;
    }
  }

  status = addLikePolynomialTerms(node);
  if (status.hasChanged()) {
    return status;
  }

  return Node.Status.noChange(node);
}
function addLikeTerms(node, polynomialOnly=false) {
  if (!Node.Type.isOperator(node)) {
    return Node.Status.noChange(node);
  }
  let status;

  if (!polynomialOnly) {
    status = evaluateConstantSum(node);
    if (status.hasChanged()) {
      return status;
    }
  }

  status = addLikePolynomialTerms(node);
  if (status.hasChanged()) {
    return status;
  }

  return Node.Status.noChange(node);
}
function addLikeTerms ( node , polynomialOnly = false ) { if ( ! Node . Type . isOperator ( node ) ) { return Node . Status . noChange ( node ) ; } let status ; if ( ! polynomialOnly ) { status = evaluateConstantSum ( node ) ; if ( status . hasChanged ( ) ) { return status ; } } status = addLikePolynomialTerms ( node ) ; if ( status . hasChanged ( ) ) { return status ; } return Node . Status . noChange ( node ) ; }
Adds a list of nodes that are polynomial terms. Returns a Node.Status object.
Adds a list of nodes that are polynomial terms . Returns a Node . Status object .