Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

utils.h

Go to the documentation of this file.
00001 //***************************************************************************
00002 #ifndef UTILS_H
00003 #define UTILS_H
00004 //***************************************************************************
00005 #include <limits.h>
00006 //***************************************************************************
00007 char *ExtractName(char *s);
00008 int parseArg(int argc, char *argv[], char *tag);
00009 char *printOnOff(int flag);
00010 //***************************************************************************
00011 template <class Etype>
00012 inline Etype myMin(Etype *l, int n)
00013 {
00014 Etype min = (Etype) INT_MAX;
00015 
00016 for (int i = 0; i < n; i++)
00017         {
00018          if (l[i] < min) min = l[i];
00019         }
00020 
00021 return min;
00022 }
00023 //***************************************************************************
00024 template <class Etype>
00025 inline Etype myMax(Etype *l, int n)
00026 {
00027 Etype max = (Etype) (-INT_MAX);
00028 
00029 for (int i = 0; i < n; i++)
00030         {
00031          if (l[i] > max) max = l[i];
00032         }
00033 
00034 return max;
00035 }
00036 //***************************************************************************
00037 #endif // UTILS_H
00038 //***************************************************************************

Generated on Sun Jun 16 17:36:42 2002 for Anirudh's Vortex-Wake Simulation Code by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001