summaryrefslogtreecommitdiff
path: root/utils/maybe_update_bound.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-19 04:46:18 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-19 04:46:18 +0000
commite10981b37ecc42cafca3e6d05e1eb44602b213b3 (patch)
tree3adb3e239c0fddc6dfa7850e21c7ae4ab3d64e6c /utils/maybe_update_bound.h
parent1f196ed477d4ad445a00bb1836dd51d3507e063d (diff)
ValueArray instead of string for state is 10% faster
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@599 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/maybe_update_bound.h')
-rwxr-xr-xutils/maybe_update_bound.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/maybe_update_bound.h b/utils/maybe_update_bound.h
new file mode 100755
index 00000000..d57215d0
--- /dev/null
+++ b/utils/maybe_update_bound.h
@@ -0,0 +1,17 @@
+#ifndef MAYBE_UPDATE_BOUND_H
+#define MAYBE_UPDATE_BOUND_H
+
+template <class To,class From>
+inline void maybe_increase_max(To &to,const From &from) {
+ if (to<from)
+ to=from;
+}
+
+template <class To,class From>
+inline void maybe_decrease_min(To &to,const From &from) {
+ if (from<to)
+ to=from;
+}
+
+
+#endif