public Complex[] solveAll(Complex coefficients[],Complex initial) throws MathIllegalArgumentException, NullArgumentException, MathIllegalStateException {
  if (coefficients == null) {
    throw new NullArgumentException();
  }
  final int n=coefficients.length - 1;
  if (n == 0) {
    throw new MathIllegalArgumentException(LocalizedCoreFormats.POLYNOMIAL);
  }
  final Complex c[]=new Complex[n + 1];
  for (int i=0; i <= n; i++) {
    c[i]=coefficients[i];
  }
  final Complex root[]=new Complex[n];
  for (int i=0; i < n; i++) {
    final Complex subarray[]=new Complex[n - i + 1];
    System.arraycopy(c,0,subarray,0,subarray.length);
    root[i]=solve(subarray,initial);
    Complex newc=c[n - i];
    Complex oldc=null;
    for (int j=n - i - 1; j >= 0; j--) {
      oldc=c[j];
      c[j]=newc;
      newc=oldc.add(newc.multiply(root[i]));
    }
  }
  return root;
}

public Complex [ ] solveAll ( Complex coefficients [ ] , Complex initial ) throws MathIllegalArgumentException , NullArgumentException , MathIllegalStateException { if ( coefficients == null ) { throw new NullArgumentException ( ) ; } final int n = coefficients . length - 1 ; if ( n == 0 ) { throw new MathIllegalArgumentException ( LocalizedCoreFormats . POLYNOMIAL ) ; } final Complex c [ ] = new Complex [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { c [ i ] = coefficients [ i ] ; } final Complex root [ ] = new Complex [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { final Complex subarray [ ] = new Complex [ n - i + 1 ] ; System . arraycopy ( c , 0 , subarray , 0 , subarray . length ) ; root [ i ] = solve ( subarray , initial ) ; Complex newc = c [ n - i ] ; Complex oldc = null ; for ( int j = n - i - 1 ; j >= 0 ; j -- ) { oldc = c [ j ] ; c [ j ] = newc ; newc = oldc . add ( newc . multiply ( root [ i ] ) ) ; } } return root ; }
find all complex roots for the polynomial with the given coefficients , starting from the given initial value .
