From 4341a47d823808e71a4d66eab4b87cbfcafee4ad Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 13 Jan 2015 12:36:10 -0500 Subject: [PATCH] break ties pessimistically --- openbr/core/eval.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 8c8b70e..70192fd 100755 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -36,7 +36,12 @@ struct Comparison Comparison() {} Comparison(float _score, int _target, int _query, bool _genuine) : score(_score), target(_target), query(_query), genuine(_genuine) {} - inline bool operator<(const Comparison &other) const { return score > other.score; } + + inline bool operator<(const Comparison &other) const + { + if (score != other.score) return (score > other.score); + else return !genuine; // Tie-break favors pessimistic behavior of ranking impostors higher. + } }; #undef FAR // Windows preprecessor definition conflicts with variable name -- libgit2 0.21.4