SymmLQ extends PreconditionedIterativeLinearSolver { @Override public RealVector solveInPlace(final RealLinearOperator a, final RealLinearOperator m, final RealVector b, final RealVector x) throws NullArgumentException, NonSquareOperatorException, DimensionMismatchException, NonSelfAdjointOperatorException, NonPositiveDefiniteOperatorException, IllConditionedOperatorException, MaxCountExceededException { return solveInPlace(a, m, b, x, false, 0.); } SymmLQ(final int maxIterations, final double delta,
                  final boolean check);  SymmLQ(final IterationManager manager, final double delta,
                  final boolean check); final boolean getCheck(); @Override RealVector solve(final RealLinearOperator a,
        final RealLinearOperator m, final RealVector b); RealVector solve(final RealLinearOperator a,
        final RealLinearOperator m, final RealVector b, final boolean goodb,
        final double shift); @Override RealVector solve(final RealLinearOperator a,
        final RealLinearOperator m, final RealVector b, final RealVector x); @Override RealVector solve(final RealLinearOperator a, final RealVector b); RealVector solve(final RealLinearOperator a, final RealVector b,
        final boolean goodb, final double shift); @Override RealVector solve(final RealLinearOperator a, final RealVector b,
        final RealVector x); @Override RealVector solveInPlace(final RealLinearOperator a,
        final RealLinearOperator m, final RealVector b, final RealVector x); RealVector solveInPlace(final RealLinearOperator a,
        final RealLinearOperator m, final RealVector b,
        final RealVector x, final boolean goodb, final double shift); @Override RealVector solveInPlace(final RealLinearOperator a,
        final RealVector b, final RealVector x);  }
@Test public void testUnpreconditionedInPlaceSolutionWithInitialGuess() { final int n = 5; final int maxIterations = 100; final RealLinearOperator a = new HilbertMatrix(n); final InverseHilbertMatrix ainv = new InverseHilbertMatrix(n); final IterativeLinearSolver solver; solver = new SymmLQ(maxIterations, 1E-10, true); final RealVector b = new ArrayRealVector(n); for (int j = 0; j < n; j++) { b.set(0.); b.setEntry(j, 1.); final RealVector x0 = new ArrayRealVector(n); x0.set(1.); final RealVector x = solver.solveInPlace(a, b, x0); Assert.assertSame("x should be a reference to x0", x0, x); for (int i = 0; i < n; i++) { final double actual = x.getEntry(i); final double expected = ainv.getEntry(i, j); final double delta = 1E-6 * FastMath.abs(expected); final String msg = String.format("entry[%d][%d)", i, j); Assert.assertEquals(msg, expected, actual, delta); } } }