| 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 | { |
nothing calls this directly
no test coverage detected