diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-27 19:26:31 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-27 19:26:31 +0000 |
commit | 1eab70e16f0e0d5531f3babfea2062c82f6362e1 (patch) | |
tree | a1ea1930e585b9356c6e089465baa969bb6919bb /utils/best.h | |
parent | 6ddaff1341e565dd91dca7ea763d0ea4d897f4c7 (diff) |
compiles
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@626 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/best.h')
-rwxr-xr-x | utils/best.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/best.h b/utils/best.h index 8ff896bb..689e7600 100755 --- a/utils/best.h +++ b/utils/best.h @@ -8,6 +8,21 @@ typedef MaxPlus<double> best_t; inline bool operator <(best_t const& a,best_t const& b) { return a.v_>b.v_; // intentionally reversed, so default min-heap, sort, etc. put best first. } +struct BetterP { + inline bool operator ()(best_t const& a,best_t const& b) const { + return a.v_>b.v_; // intentionally reversed, so default min-heap, sort, etc. put best first. + } +}; +inline void maybe_improve(best_t &a,best_t const& b) { + if (a.v_>b.v_) + a.v_=b.v_; +} + +template <class O> +inline void maybe_improve(best_t &a,O const& b) { + if (a.v_>b.v_) + a.v_=b.v_; +} #endif |