Home > K25104 > LinearSystems > untransformed_preconditioned_CG_script.m

untransformed_preconditioned_CG_script

PURPOSE ^

Usage example for untransformed_preconditioned_CG

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for untransformed_preconditioned_CG

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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 )

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