/** Test sequential twosided GBase. */
  public void testSequentialTSGBase() {
    L = new ArrayList<GenSolvablePolynomial<BigInteger>>();

    L.add(a);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L.size() );
    assertTrue("isTwosidedGB( { a } )", sbb.isTwosidedGB(L));

    L.add(b);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L.size() );
    assertTrue("isTwosidedGB( { a, b } )", sbb.isTwosidedGB(L));

    L.add(c);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L.size() );
    assertTrue("isTwosidedGB( { a, b, c } )", sbb.isTwosidedGB(L));

    L.add(d);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L.size() );
    assertTrue("isTwosidedGB( { a, b, c, d } )", sbb.isTwosidedGB(L));

    L.add(e);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L.size() );
    assertTrue("isTwosidedGB( { a, b, c, d, e } )", sbb.isTwosidedGB(L));
  }
Ejemplo n.º 2
0
 @SuppressWarnings("unchecked")
 static void checkGB(PolynomialList S) {
   if (!doCheck) {
     return;
   }
   SolvableGroebnerBaseAbstract sbb = new SolvableGroebnerBaseSeq();
   long t = System.currentTimeMillis();
   boolean chk = sbb.isLeftGB(S.list, false);
   t = System.currentTimeMillis() - t;
   System.out.println("check isGB = " + chk + " in " + t + " milliseconds");
 }
  /** Test Weyl sequential twosided GBase is always 1. */
  public void testWeylSequentialTSGBase() {
    // int rloc = 4;
    // ring = new GenSolvablePolynomialRing<BigInteger>(cfac,rloc);

    RelationGenerator<BigInteger> wl = new WeylRelations<BigInteger>();
    wl.generate(ring);
    table = ring.table;

    a = ring.random(kl, ll, el, q);
    b = ring.random(kl, ll, el, q);
    c = ring.random(kl, ll, el, q);
    d = ring.random(kl, ll, el, q);
    e = d; // ring.random(kl, ll, el, q );

    L = new ArrayList<GenSolvablePolynomial<BigInteger>>();

    L.add(a);
    // System.out.println("La = " + L );
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L );
    assertTrue("isTwosidedGB( { a } )", sbb.isTwosidedGB(L));

    L.add(b);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L );
    assertTrue("isTwosidedGB( { a, b } )", sbb.isTwosidedGB(L));

    L.add(c);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L );
    assertTrue("isTwosidedGB( { a, b, c } )", sbb.isTwosidedGB(L));

    L.add(d);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L );
    assertTrue("isTwosidedGB( { a, b, c, d } )", sbb.isTwosidedGB(L));

    L.add(e);
    L = sbb.twosidedGB(L);
    // System.out.println("L = " + L );
    assertTrue("isTwosidedGB( { a, b, c, d, e } )", sbb.isTwosidedGB(L));
  }