Attachment 'U01_test_mydet.m'
Download 1 function U01_test_mydet
2 %U01_TEST_MYDET Test mydet.
3 %
4 %usage
5 % U06_test_mydet
6 %
7 %author
8 % saputra@cs.tu-berlin.de
9
10 % Data
11 A = [
12 0.168879971344252 0.313027488227721 0.183336706183362 0.383884490005655 0.189862477802470
13 0.745166604030062 0.076439457812078 0.076918942246006 0.650748947230908 0.646501755218381
14 0.477134351507709 0.791415146963651 0.153662766530705 0.817370524039485 0.003605304507345
15 0.653444541099485 0.365383979290258 0.826875990170966 0.766266219369973 0.282887905349612
16 0.966575933053896 0.585099389225412 0.300956742633309 0.374175557582085 0.638600594751137];
17
18 % Correct distances
19 correct_det = -0.069223578402787;
20
21 % Run test.
22
23 if exist('mydet.m', 'file')
24 fprintf('Testing mydet.m ...\n');
25 for k=1:5
26 my_det = mydet(A, k);
27
28 if abs(my_det - correct_det) > 1e-10
29 fprintf('failed for k = %i (discrepancy > 1e-10).\n', k);
30 else
31 fprintf('OK for k = %i.\n', k);
32 end
33 end
34 end
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.