function exercise_1_6_5() % % % Written by: % -- % John L. Weatherwax 2006-12-13 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; airfoil % Part (a): % figure; spy(A); title( 'airfoil' ); tic, R = chol(A); t=toc; fprintf('Time to directly Cholesky factor airfoil = %f\n', t ); fprintf( 'Number of non zeros of the Cholesky factor of airfoil = %d (=%f percent)\n', nnz(R), nnz(R)/prod(size(A)) ); figure; spy(R); title( 'Cholesky factor of airfoil' ); pause; close all; % Part (b): % p = symrcm(A); arcm = A(p,p); figure; spy(arcm); title( 'Reverse Cuthill-McKee ordered version of airfoil' ); tic, R = chol(arcm); t=toc; fprintf('Time to factor the reverse Cuthill-McKee ordered Cholesky factor airfoil = %f\n', t ); fprintf( 'Number of non zeros of the Cholesky factor of airfoil = %d (=%f percent)\n', nnz(R), nnz(R)/prod(size(A)) ); figure; spy(R); title( 'Cholesky factor of reverse cuthill-McKee ordered airfoil' ); % Part (c): % pause; close all; %p = symmmd(A); p = symamd(A); ammd = A(p,p); figure; spy(ammd); title( 'Minimum degree ordering of airfoil' ); tic, R = chol(ammd); t=toc; fprintf('Time to factor the minimum degree ordering Cholesky factor airfoil = %f\n', t ); fprintf( 'Number of non zeros of the Cholesky factor of airfoil = %d (=%f percent)\n', nnz(R), nnz(R)/prod(size(A)) ); figure; spy(R); title( 'Cholesky factor of the minimum degree ordering of airfoil' ); pause; close all; return;