[249cf9]: / testing / test_realout.m  Maximize  Restore  History

Download this file

74 lines (46 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function test_failed=test_realout
%TEST_REALOUT Test if functions produce real-valued output
test_failed=0;
disp(' =============== TEST_REALOUT ================');
a = 7;
M = 19;
W = 3;
L = a*M*4;
Nwil = L/(2*M);
Nmd = L/M;
Ngab = L/a;
Nfft = 19;
test_failed=realhelper(test_failed,'dwilt',randn(L,W),randn(L,1),M);
test_failed=realhelper(test_failed,'dwilt',randn(L,W),randn(2*M,1),M);
test_failed=realhelper(test_failed,'wmdct',randn(L,W),randn(L,1),M);
test_failed=realhelper(test_failed,'wmdct',randn(L,W),randn(2*M,1),M);
test_failed=realhelper(test_failed,'idwilt',randn(2*M,Nwil),randn(L,1));
test_failed=realhelper(test_failed,'idwilt',randn(2*M,Nwil),randn(2*M,1));
test_failed=realhelper(test_failed,'iwmdct',randn(M,Nmd),randn(L,1));
test_failed=realhelper(test_failed,'iwmdct',randn(M,Nmd),randn(2*M,1));
test_failed=realhelper(test_failed,'gabdual',randn(L,1),a,M);
test_failed=realhelper(test_failed,'gabdual',randn(L,1),a,M);
test_failed=realhelper(test_failed,'gabtight',randn(M,1),a,M);
test_failed=realhelper(test_failed,'gabtight',randn(M,1),a,M);
test_failed=realhelper(test_failed,'dcti',randn(Nfft,1));
test_failed=realhelper(test_failed,'dctii',randn(Nfft,1));
test_failed=realhelper(test_failed,'dctiii',randn(Nfft,1));
test_failed=realhelper(test_failed,'dctiv',randn(Nfft,1));
test_failed=realhelper(test_failed,'dsti',randn(Nfft,1));
test_failed=realhelper(test_failed,'dstii',randn(Nfft,1));
test_failed=realhelper(test_failed,'dstiii',randn(Nfft,1));
test_failed=realhelper(test_failed,'dstiv',randn(Nfft,1));
test_failed=realhelper(test_failed,'pfilt',randn(L,1),randn(L,1));
c=dgtreal(randn(L,W),randn(L,1),a,M);
test_failed=realhelper(test_failed,'idgtreal',c,randn(L,1),a,M);
test_failed=realhelper(test_failed,'idgtreal',c,randn(M,1),a,M);
c=fftreal(randn(Nfft,1));
test_failed=realhelper(test_failed,'ifftreal',c,Nfft);
function test_failed=realhelper(test_failed,funname,varargin)
outres=feval(funname,varargin{:});
res=~isreal(outres);
if res>0
outres
end;
[test_failed,fail]=ltfatdiditfail(res,test_failed);
fprintf('REAL %s %i %s\n',funname,res,fail);