Usage example for transformed_preconditioned_CG
0001 % Usage example for transformed_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 P*P' is the inverse of the 0012 % diagonal of A 0013 P = sqrt(inv(diag(diag(A)))); 0014 tol = 1e-6; 0015 0016 [ x,k ] = transformed_preconditioned_CG(A,b,P,tol )