MCPcopy Create free account
hub / github.com/davisking/dlib / test_real_compile_time_sized_ffts

Function test_real_compile_time_sized_ffts

dlib/test/fft.cpp:166–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165 template <long nr, long nc>
166 void test_real_compile_time_sized_ffts()
167 {
168 print_spinner();
169 const matrix<complex<double>,nr,nc> m1 = complex_matrix(rand_real<double>(nr,nc));
170 const matrix<complex<float>,nr,nc> fm1 = complex_matrix(rand_real<float>(nr,nc));
171
172 DLIB_TEST(max(norm(ifft(fft(complex_matrix(real(m1))))-m1)) < 1e-16);
173 DLIB_TEST(max(norm(ifft(fft(complex_matrix(real(fm1))))-fm1)) < 1e-7);
174
175 matrix<complex<double>,nr,nc> temp = m1;
176 matrix<complex<float>,nr,nc> ftemp = fm1;
177 fft_inplace(temp);
178 fft_inplace(ftemp);
179 DLIB_TEST(max(norm(temp-fft(m1))) < 1e-16);
180 DLIB_TEST(max(norm(ftemp-fft(fm1))) < 1e-7);
181 ifft_inplace(temp);
182 ifft_inplace(ftemp);
183 DLIB_TEST(max(norm(temp/temp.size()-m1)) < 1e-16);
184 DLIB_TEST(max(norm(ftemp/ftemp.size()-fm1)) < 1e-7);
185 }
186
187 void test_random_real_ffts()
188 {

Callers

nothing calls this directly

Calls 10

print_spinnerFunction · 0.85
complex_matrixFunction · 0.85
normFunction · 0.85
ifftFunction · 0.85
realFunction · 0.85
maxFunction · 0.50
fftFunction · 0.50
fft_inplaceFunction · 0.50
ifft_inplaceFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected