Usage example for untransformed_preconditioned_CG
0001 % Usage example for untransformed_preconditioned_CG 0002 0003 A = [3 1 0 0; 0004 1 4 1 3; 0005 0 1 10 0; 0006 0 3 0 3]; 0007 b = [1; 0008 1; 0009 1; 0010 1]; 0011 % the preconditioner is chosen such that S is the inverse of the 0012 % diagonal of A 0013 S = inv(diag(diag(A))); 0014 tol = 1e-6; 0015 0016 [ x,k ] = untransformed_preconditioned_CG(A,b,S,tol )