/** Test coefficient map function. */ public void testMap() { // integers BigInteger rf = new BigInteger(); // System.out.println("rf = " + rf); // polynomials over integral numbers GenPolynomialRing<BigInteger> pf = new GenPolynomialRing<BigInteger>(rf, rl); // System.out.println("pf = " + pf); // random polynomial GenPolynomial<BigInteger> p = pf.random(kl, 2 * ll, el, q); // System.out.println("p = " + p); // test times 1 GenPolynomial<BigInteger> q; q = p.map(new Multiply<BigInteger>(rf.getONE())); assertEquals("p == q ", p, q); // test times 0 q = p.map(new Multiply<BigInteger>(rf.getZERO())); assertTrue("q == 0 ", q.isZERO()); // test times -1 q = p.map(new Multiply<BigInteger>(rf.getONE().negate())); assertEquals("p == q ", p.negate(), q); }