/** {@inheritDoc} */ @Override public IASTMutable copy() { return new AST2(arg0, arg1, arg2); }
AST2 result = new AST2(F.List, F.C0, F.C1); if (expr.equals(period)) { return result; for (int i = 1; i < ast.size(); i++) { if (ast.get(i).equals(period)) { result.set(2, ast.removeAtCopy(i).getOneIdentity(F.C1)); return result; IAST temp = getPeriodicParts(ast.get(i), period); if (temp.isPresent() && temp.arg1().isZero()) { result.set(1, ast.removeAtCopy(i).getOneIdentity(F.C0)); result.set(2, temp.arg2()); return result;
public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return new AST1(arg0, arg1); } if (fromPosition == 3) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }
/** * Create a function with 2 arguments as a <code>AST2</code> immutable object without evaluation. * * @param head * @param a0 * @param a1 * @return */ public final static IASTMutable binaryAST2(final IExpr head, final IExpr a0, final IExpr a1) { return new AST2(head, a0, a1); }
public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return new AST1(arg0, arg1); } if (fromPosition == 3) { return new AST2(arg0, arg1, arg2); } if (fromPosition == 4) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }