コード例 #1
0
 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();
   }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 static IntegerDivisor create(JsclInteger integer) {
   Generic a = Factorization.factorize(integer);
   return new IntegerDivisor(a, a.variables(), Monomial.iteratorOrdering);
 }