rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
test_orthonormalize.m
Go to the documentation of this file.
1 function OK = test_orthonormalize
2 % function performing a test of the orthonormalization routine by
3 % generating a time-sequence of data and orthogonalizing this.
4 % returns 1, if test is OK, 0 otherwise
5 
6 % Bernard Haasdonk
7 
8 OK = 1;
9 
10 load('test_rb_lin_evol_data');
11 model_data = gen_model_data(model);
12 sim_data = detailed_simulation(model,model_data);
13 A = model_data.W;
14 UON = orthonormalize_qr(sim_data.U,A);
15 B = UON' * A * UON;
16 
17 E = eye(size(B));
18 i_zero = find(E==0);
19 i_nonzero = find(E~=0);
20 
21 if (find(B>0.9999)~=i_nonzero)
22  disp('gram-matrix not the identity!');
23  OK = 0;
24 end;
25 
26 if (find(B<0.0001)~=i_zero)
27  disp('gram-matrix not the identity!');
28  OK = 0;
29 end;
30 
31 %pcolor(B);
32 
33 %| \docupdate