Commit 835e0bd8 authored by Davis King's avatar Davis King

Changed test_ranking_function() and cross_validate_ranking_trainer() slightly

to avoid a run time error in gcc 4.7.
parent 967cd822
......@@ -227,7 +227,7 @@ namespace dlib
return true;
else if (a.first > b.first)
return false;
else if (a.second == true)
else if (a.second && !b.second)
return true;
else
return false;
......
......@@ -144,6 +144,10 @@ namespace
samples.push_back(p);
dlog << LINFO << "cv-accuracy: "<< cross_validate_ranking_trainer(trainer, samples,4);
DLIB_TEST(equal(cross_validate_ranking_trainer(trainer, samples,4) , res));
df.basis_vectors(0) = 0;
dlog << LINFO << "BAD RANKING:" << test_ranking_function(df, samples);
DLIB_TEST(test_ranking_function(df, samples)(1) < 0.5);
}
// ----------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment