9 cgm = conjugate_gradient_method(A, b, x0, 1e-6, 1000);
10 pcgm = preconditioned_conjugate_gradient_method(A, M, b, x0, 1e-6, 1000);
11 diff = norm(cgm - pcgm);
13 unit_test_equals("PCGM agrees with CGM when M == I", ...
17 pcgm_simple = simple_preconditioned_cgm(A, M, b, x0, 1e-6, 1000);
18 diff = norm(pcgm_simple - pcgm);
20 unit_test_equals("PCGM agrees with SimplePCGM when M == I", ...
24 ## Needs to be symmetric!
25 M = [0.97466, 0.24345, 0.54850; ...
26 0.24345, 0.73251, 0.76639; ...
27 0.54850, 0.76639, 1.47581];
29 pcgm = preconditioned_conjugate_gradient_method(A, M, b, x0, 1e-6, 1000);
30 diff = norm(cgm - pcgm);
32 unit_test_equals("PCGM agrees with CGM when M != I", ...
37 pcgm_simple = simple_preconditioned_cgm(A, M, b, x0, 1e-6, 1000);
38 diff = norm(pcgm_simple - pcgm);
40 unit_test_equals("PCGM agrees with Simple PCGM when M != I", ...