00001 // HtMaxMin 00002 // 00003 // macros and tools for computing max and min of values 00004 // 00005 // Part of the ht://Dig package <http://www.htdig.org/> 00006 // Copyright (c) 1999, 2000, 2001 The ht://Dig Group 00007 // For copyright details, see the file COPYING in your distribution 00008 // or the GNU General Public License version 2 or later 00009 // <http://www.gnu.org/copyleft/gpl.html> 00010 // 00011 // $Id: HtMaxMin_8h-source.html,v 1.1 2008年06月08日 10:12:54 sebdiaz Exp $ 00012 // 00013 00014 #ifndef _HtMaxMin_h_ 00015 #define _HtMaxMin_h_ 00016 00017 #define HtMAX(a,b) (((a)>(b)) ? (a) : (b)) 00018 #define HtMIN(a,b) (((a)<(b)) ? (a) : (b)) 00019 00020 00021 // Max/Min value of an array 00022 class HtMaxMin 00023 { 00024 public: 00025 // compute max/min of an array of values 00026 static unsigned int max_v(unsigned int *vals, int n); 00027 static unsigned short max_v(unsigned short *vals, int n); 00028 static unsigned char max_v(unsigned char *vals, int n); 00029 static unsigned int min_v(unsigned int *vals, int n); 00030 static unsigned short min_v(unsigned short *vals, int n); 00031 static unsigned char min_v(unsigned char *vals, int n); 00032 }; 00033 00034 00035 00036 #endif