% compare classical and modified Gram-Schmidt
clear all;close all;

v=[1 2 2 1 ; 2 3 4 4;3 6 7 2; 4 3 5 1]
% Classical:
u=cgs(v)
disp('orthonormality:')
u'*u
% Modified:
u=mgs(v)
disp('orthonormality:')
u'*u


% both do badly
v=[1 2;1 2.00001];
u=cgs(v)
u'*u
u=mgs(v)
u'*u