code: public static double solve(Matrix A, Preconditioner Ap, double[] b, double[] x, double tol, int itol) {
          return solve(A, Ap, b, x, tol, itol, 2 * Math.max(A.nrows(), A.ncols()));
      }
docs: Solves A * x = b by iterative biconjugate gradient method.
  @param Ap the preconditioned matrix of A.
  @param b the right hand side of linear equations.
  @param x on input, x should be set to an initial guess of the solution
  (or all zeros). On output, x is reset to the improved solution.
  @param itol specify which convergence test is applied. If itol = 1,
  iteration stops when |Ax - b| / |b| is less than the parameter tolerance.
  If itol = 2, the stop criterion is
  |A<sup>-1</sup> (Ax - b)| / |A<sup>-1</sup>b| is less than tolerance.
  If tol = 3, |x<sub>k+1</sub> - x<sub>k</sub>|<sub>2</sub> is less than
  tolerance. The setting of tol = 4 is same as tol = 3 except that the
  L<sub>&infin;</sub> norm instead of L<sub>2</sub>.
  @param tol the desired convergence tolerance.
  @return the estimated error.