| 697 | |
| 698 | template <typename map_problem> |
| 699 | void do_test( |
| 700 | ) |
| 701 | { |
| 702 | print_spinner(); |
| 703 | std::vector<unsigned long> map_assignment1, map_assignment2; |
| 704 | map_problem prob; |
| 705 | find_max_factor_graph_nmplp(prob, map_assignment1, 1000, 1e-8); |
| 706 | |
| 707 | const double score1 = find_total_score(prob, map_assignment1); |
| 708 | |
| 709 | brute_force_find_max_factor_graph_nmplp(prob, map_assignment2); |
| 710 | const double score2 = find_total_score(prob, map_assignment2); |
| 711 | |
| 712 | dlog << LINFO << "score NMPLP: " << score1; |
| 713 | dlog << LINFO << "score MAP: " << score2; |
| 714 | |
| 715 | DLIB_TEST(std::abs(score1 - score2) < 1e-10); |
| 716 | DLIB_TEST(mat(map_assignment1) == mat(map_assignment2)); |
| 717 | } |
| 718 | |
| 719 | // ---------------------------------------------------------------------------------------- |
| 720 |
nothing calls this directly
no test coverage detected