Home > K25104 > LinearSystems > transformed_preconditioned_CG_script.m

transformed_preconditioned_CG_script

PURPOSE ^

Usage example for transformed_preconditioned_CG

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for transformed_preconditioned_CG

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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 )

Generated on Mon 18-Jan-2016 10:25:49 by m2html © 2005