Preconditioner conditioner = new JacobiConditioner(a);
ConjugateGradientSolver solver = new ConjugateGradientSolver();
Vector x = solver.solve(a, b, null, 100, ConjugateGradientSolver.DEFAULT_MAX_ERROR);
double distance = Math.sqrt(a.times(x).getDistanceSquared(b));
assertEquals(0.0, distance, EPSILON);
assertEquals(0.0, solver.getResidualNorm(), ConjugateGradientSolver.DEFAULT_MAX_ERROR);
assertEquals(16, solver.getIterations());
Vector x2 = solver.solve(a, b, conditioner, 100, ConjugateGradientSolver.DEFAULT_MAX_ERROR);