function [T0,T1,T2,L1,U1,T1inv,L2,U2,T2inv]=demo_symtridiag(n)
% demo the relative merits of different versions of symtridag using the
% example of p.86 (without the factor of 25)
% interesting to (a) compare timings and 
% (b) compare what is plotted when the output args are passed to spy
d = 2*ones(n,1);
e = -ones(n-1,1);
'version 0'
tic,T0 = symtridiag(d,e,0);toc
'version 1'
tic,T1 = symtridiag(d,e,1);toc
'version 2'
tic,T2 = symtridiag(d,e,2);toc
fprintf('hit any key to continue\n')
pause
'LU of (full) T1'
tic,[L1,U1] = lu(T1);toc
'LU of (sparse) T2'
tic,[L2,U2] = lu(T2);toc
fprintf('hit any key to continue\n')
pause
'inverse of (full) T1'
tic,T1inv = inv(T1);toc
'inverse of (sparse) T2'
tic,T2inv = inv(T2);toc

