diff -r b490093b0ac3 -r 5f954c0d34fc include/common.h --- 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 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 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