public Vector<BigIntegerPoly> ifactor()
        {
                /* this ought be entirely rewritten in terms of the LLL algorithm
                */
                Vector<BigIntegerPoly> fac = new Vector<BigIntegerPoly>() ;

                /* collect integer roots (polynomial factors of degree 1) */
                Vector<BigInteger> r = iroots() ;
                BigIntegerPoly[] res = new BigIntegerPoly[2] ;
                res[0] = this ;
                for( BigInteger i : r)
                {
                        int deg = rootDeg(i) ;
                        /* construct  the factor x-i */
                        BigIntegerPoly f = new BigIntegerPoly(""+i.negate()+",1") ;
                        for(int mu =0 ; mu < deg ; mu++)
                        {
                                fac.add(f) ;
                                res = res[0].divideAndRemainder(f) ;
                        }
                }

                /* collect factors which are polynomials of degree 2
                */
                Vector<BigIntegerPoly> pol2 = i2roots() ;
                for( BigIntegerPoly i : pol2)
                {
                        /* the internal loop catches cases with higher
                        * powers of individual polynomials (of actual degree 2 or 4...)
                        */
                        while ( res[0].degree() >= 2)
                        {
                                try
                                {
                                        BigIntegerPoly[] dtst  = res[0].divideAndRemainder(i) ;
                                        if ( dtst[1].isZero() )
                                        {
                                                fac.add(i) ;
                                                res = dtst ;
                                        }
                                        else
                                                break ;
                                }
                                catch(ArithmeticException ex)
                                {
                                        break ;
                                }
                        }
                }

                /* add remaining factor, if not equal to 1
                */
                if ( res[0].degree() >0 || res[0].a.firstElement().compareTo (BigInteger.ONE) != 0 )
                        fac.add(res[0]) ;
                return fac ;
        } /* ifactor */