IpUtils.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2006 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpUtils.hpp 759 2006-07-07 03:07:08Z andreasw $
00006 //
00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
00008 
00009 #ifndef __IPUTILS_HPP__
00010 #define __IPUTILS_HPP__
00011 
00012 // Standard Ip Include Files
00013 #include "IpTypes.hpp"
00014 #include "IpDebug.hpp"
00015 
00016 namespace Ipopt
00017 {
00018 
00019   inline ipfint Max(ipfint a, ipfint b)
00020   {
00021     return ((a) > (b) ? (a) : (b));
00022   }
00023 
00024   inline ipfint Min(ipfint a, ipfint b)
00025   {
00026     return ((a) < (b) ? (a) : (b));
00027   }
00028 
00029   inline Number Max(Number a, Number b)
00030   {
00031     return ((a) > (b) ? (a) : (b));
00032   }
00033 
00034   inline Number Max(Number a, Number b, Number c)
00035   {
00036     Number max = Max(a,b);
00037     max = Max(max, c);
00038     return max;
00039   }
00040 
00041   inline Number Max(Number a, Number b, Number c, Number d)
00042   {
00043     Number max = Max(a, b, c);
00044     max = Max(max, d);
00045     return max;
00046   }
00047 
00048   inline Number Min(Number a, Number b)
00049   {
00050     return ((a) < (b) ? (a) : (b));
00051   }
00052 
00053   inline Number Min(Number a, Number b, Number c)
00054   {
00055     Number min = Min(a,b);
00056     min = Min(min, c);
00057     return min;
00058   }
00059 
00060   inline Number Min(Number a, Number b, Number c, Number d)
00061   {
00062     Number min = Min(a, b, c);
00063     min = Min(min, d);
00064     return min;
00065   }
00066 
00069   bool IsFiniteNumber(Number val);
00070 
00071 } //namespace Ipopt
00072 
00073 #endif

Generated on Fri Sep 26 07:44:13 2008 for SimTKcore by  doxygen 1.5.6