--- a/include/common.h Thu Dec 13 00:08:11 2007 +0100
+++ b/include/common.h Fri Dec 14 00:05:54 2007 +0100
@@ -44,4 +44,40 @@
}
}
+template<typename Type> const Type &min3(const Type &a, const Type &b, const Type &c)
+{
+ if (a <= b)
+ {
+ if (a <= c)
+ return a;
+ else
+ return c;
+ }
+ else
+ {
+ if (b <= c)
+ return b;
+ else
+ return c;
+ }
+}
+
+template<typename Type> const Type &max3(const Type &a, const Type &b, const Type &c)
+{
+ if (a >= b)
+ {
+ if (a >= c)
+ return a;
+ else
+ return c;
+ }
+ else
+ {
+ if (b >= c)
+ return b;
+ else
+ return c;
+ }
+}
+
#endif