@Nonnull public Variable newInstance() { return new ImplicitFunction(name, new Generic[parameters.length], derivations, subscripts); } }
public Generic derivative(int n) { int c[] = new int[derivations.length]; for (int i = 0; i < c.length; i++) { if (i == n) c[i] = derivations[i] + 1; else c[i] = derivations[i]; } return new ImplicitFunction(name, parameters, c, subscripts).selfExpand(); }
public Generic antiDerivative(int n) throws NotIntegrableException { int c[] = new int[derivations.length]; for (int i = 0; i < c.length; i++) { if (i == n) { if (derivations[i] > 0) c[i] = derivations[i] - 1; else throw new NotIntegrableException(this); } else c[i] = derivations[i]; } return new ImplicitFunction(name, parameters, c, subscripts).selfExpand(); }
public static int[] algebra(Generic generic) { if (generic.signum() == 0) return null; Variable v = generic.variableValue(); if (v instanceof ImplicitFunction) { Generic g[] = ((ImplicitFunction) v).getParameters(); int p = g[0].integerValue().intValue(); int q = g[1].integerValue().intValue(); if (v.compareTo(new ImplicitFunction("cl", new Generic[]{JsclInteger.valueOf(p), JsclInteger.valueOf(q)}, new int[]{0, 0}, new Generic[]{})) == 0) return new int[]{p, q}; } throw new ArithmeticException(); }
return new ImplicitFunction(name, a, derivations, ArrayUtils.toArray(subscripts, new Generic[subscripts.size()]));
static Ordering ordering(Generic generic) { Variable v = generic.variableValue(); if (v.compareTo(new Constant("lex")) == 0) return Monomial.lexicographic; else if (v.compareTo(new Constant("tdl")) == 0) return Monomial.totalDegreeLexicographic; else if (v.compareTo(new Constant("drl")) == 0) return Monomial.degreeReverseLexicographic; else if (v instanceof ImplicitFunction) { Generic g[] = ((ImplicitFunction) v).getParameters(); int k = g[0].integerValue().intValue(); if (v.compareTo(new ImplicitFunction("elim", new Generic[]{JsclInteger.valueOf(k)}, new int[]{0}, new Generic[]{})) == 0) return Monomial.kthElimination(k); } throw new ArithmeticException(); }