public static Generic compute(Generic generic) { try { return GenericVariable.content(factorize(generic.integerValue())); } catch (NotIntegerException e) { Factorization f = new Factorization(Polynomial.factory(generic.variables(), Monomial.iteratorOrdering, -1)); f.computeValue(generic); return f.getValue(); } }
void process(Generic generic[]) { boolean flag = true; for (int i = 0; i < generic.length; i++) { Generic s = generic[i]; Variable va[] = s.variables(); if (va.length == 1) { Variable t = va[0]; Polynomial p = Polynomial.factory(t).valueOf(s); if (p.degree() > 1) { flag = false; Polynomial r[] = linearize(p, t); for (int j = 0; j < r.length; j++) { process( Basis.compute(Basis.augment(new Generic[] {r[j].genericValue()}, generic), unknown) .elements()); } } } else flag = false; } if (flag) result.add(generic); }
IntegerDivisor(Generic generic, Variable unknown[], Ordering ordering) { super(Polynomial.factory(unknown, ordering).valueOf(generic).head().monomial()); }