| 150 | // ----------------------------------- |
| 151 | |
| 152 | void test_stuff ( |
| 153 | long csize |
| 154 | ) |
| 155 | { |
| 156 | print_spinner(); |
| 157 | dlog << LINFO << "csize: "<< csize; |
| 158 | matrix<double> m = randm(10,10,rnd); |
| 159 | |
| 160 | m = make_symmetric(m); |
| 161 | |
| 162 | DLIB_TEST(equal(symmetric_matrix_cache<float>(m, csize), matrix_cast<float>(m))); |
| 163 | DLIB_TEST(equal(symmetric_matrix_cache<double>(m, csize), matrix_cast<double>(m))); |
| 164 | |
| 165 | dlog << LINFO << "test colm/rowm"; |
| 166 | |
| 167 | |
| 168 | for (long i = 0; i < m.nr(); ++i) |
| 169 | { |
| 170 | DLIB_TEST(equal(colm(symmetric_matrix_cache<float>(m, csize),i), colm(matrix_cast<float>(m),i))); |
| 171 | DLIB_TEST(equal(rowm(symmetric_matrix_cache<float>(m, csize),i), rowm(matrix_cast<float>(m),i))); |
| 172 | // things are supposed to be symmetric |
| 173 | DLIB_TEST(equal(colm(symmetric_matrix_cache<float>(m, csize),i), trans(rowm(matrix_cast<float>(m),i)))); |
| 174 | DLIB_TEST(equal(rowm(symmetric_matrix_cache<float>(m, csize),i), trans(colm(matrix_cast<float>(m),i)))); |
| 175 | } |
| 176 | |
| 177 | dlog << LINFO << "test diag"; |
| 178 | DLIB_TEST(equal(diag(symmetric_matrix_cache<float>(m,csize)), diag(matrix_cast<float>(m)))); |
| 179 | |
| 180 | test_colm_exp(symmetric_matrix_cache<float>(m,csize), matrix_cast<float>(m)); |
| 181 | test_rowm_exp(symmetric_matrix_cache<float>(m,csize), matrix_cast<float>(m)); |
| 182 | test_diag_exp(symmetric_matrix_cache<float>(m,csize), matrix_cast<float>(m)); |
| 183 | |
| 184 | test_colm_exp(tmp(symmetric_matrix_cache<float>(m,csize)), tmp(matrix_cast<float>(m))); |
| 185 | test_rowm_exp(symmetric_matrix_cache<float>(m,csize), tmp(matrix_cast<float>(m))); |
| 186 | test_diag_exp(tmp(symmetric_matrix_cache<float>(m,csize)), tmp(matrix_cast<float>(m))); |
| 187 | } |
| 188 | |
| 189 | |
| 190 | void perform_test ( |
nothing calls this directly
no test coverage detected