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

Function do_test

dlib/test/find_max_factor_graph_nmplp.cpp:699–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

print_spinnerFunction · 0.85
find_total_scoreFunction · 0.85
absFunction · 0.85
matFunction · 0.50

Tested by

no test coverage detected