ConjugateGradientSolver { public ConjugateGradientSolver() { this.iterations = 0; this.residualNormSquared = Double.NaN; } ConjugateGradientSolver(); Vector solve(VectorIterable a, Vector b); Vector solve(VectorIterable a, Vector b, Preconditioner precond); Vector solve(VectorIterable a, 
                      Vector b, 
                      Preconditioner preconditioner, 
                      int maxIterations, 
                      double maxError); int getIterations(); double getResidualNorm(); static final double DEFAULT_MAX_ERROR; }
@Test public void testConjugateGradientSolver() { Matrix a = getA(); Vector b = getB(); ConjugateGradientSolver solver = new ConjugateGradientSolver(); Vector x = solver.solve(a, b); assertEquals(0.0, Math.sqrt(a.times(x).getDistanceSquared(b)), EPSILON); assertEquals(0.0, solver.getResidualNorm(), ConjugateGradientSolver.DEFAULT_MAX_ERROR); assertEquals(10, solver.getIterations()); }