- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/OS/src/OSUtils/OSParameters.h

Go to the documentation of this file.

    00001 /* $Id: OSParameters.h 4120 2011-03-30 06:28:16Z kmartin $ */
    00016 // CoinFinite includes <cmath> (I think) which causes a problem
    00017 //#include<CoinFinite.hpp>
    00018
    00019 //kipp fix up the infinity issue
    00020 //kipp define OSINFINITY to COIN_DBL_MAX
    00021
    00022
    00023
    00024 #ifndef OSPARAMETERS
    00025 #define OSPARAMETERS
    00026
    00027 #include "OSConfig.h"
    00028
    00029
    00030 #ifdef HAVE_CMATH
    00031 # include <cmath>
    00032 #else
    00033 # ifdef HAVE_MATH_H
    00034 #  include <math.h>
    00035 # else
    00036 #  error "don't have header file for math"
    00037 # endif
    00038 #endif
    00039 #ifdef HAVE_CFLOAT
    00040 # include <cfloat>
    00041 #else
    00042 # ifdef HAVE_FLOAT_H
    00043 #  include <float.h>
    00044 # endif
    00045 #endif
    00046 #ifdef HAVE_CIEEEFP
    00047 # include <cieeefp>
    00048 #else
    00049 # ifdef HAVE_IEEEFP_H
    00050 #  include <ieeefp.h>
    00051 # endif
    00052 #endif
    00053
    00054 #ifdef HAVE_CSTRING
    00055 # include <cstring>
    00056 #else
    00057 # ifdef HAVE_STRING_H
    00058 #  include <string.h>
    00059 # else
    00060 #  error "don't have header file for string"
    00061 # endif
    00062 #endif
    00063
    00064
    00065 #ifdef HAVE_CSTDLIB
    00066 # include <cstdlib>
    00067 #else
    00068 # ifdef HAVE_STDLIB_H
    00069 #  include <stdlib.h>
    00070 # endif
    00071 #endif
    00072
    00073 #include <string>
    00074 #include <sstream>
    00075 using std::string;
    00076 using std::ostringstream;
    00077
    00078 #define OS_PLUS 1001
    00079 #define OS_SUM  1002
    00080 #define OS_MINUS  1003
    00081 #define OS_NEGATE  1004
    00082 #define OS_TIMES  1005
    00083 #define OS_DIVIDE  1006
    00084 #define OS_POWER  1009
    00085 #define OS_PRODUCT  1010
    00086 #define OS_ABS  2001
    00087 #define OS_SQUARE  2005
    00088 #define OS_SQRT  2006
    00089 #define OS_LN  2007
    00090 #define OS_EXP  2010
    00091 #define OS_SIN  3001
    00092 #define OS_COS  3002
    00093 #define OS_MIN  4010
    00094 #define OS_MAX  4011
    00095 #define OS_ERF  4625
    00096 #define OS_NUMBER  5001
    00097 #define OS_PI  5003
    00098 #define OS_E  5004
    00099 #define OS_VARIABLE  6001
    00100 #define OS_IF  7001
    00101 #define OS_ALLDIF  7016
    00102
    00103
    00104 #define OS_E_VALUE exp(1.0)
    00105 #define OS_PI_VALUE 2*asin(1.0)
    00106
    00107 #define OS_SCHEMA_VERSION "2.0"
    00108
    00109
    00110
    00115 #define OS_NEAR_EQUAL 1e-2
    00116
    00117 #define OS_EPS 1e-12
    00118
    00119 inline double nanKludge(){
    00120         double zero = 0.0;
    00121         return 0.0/zero;
    00122 }
    00123
    00124 #ifdef NAN
    00125 #define OSNAN NAN
    00126 #elif defined NaN
    00127 #define OSNAN NaN
    00128 #elif defined nan
    00129 #define OSNAN nan
    00130 #elif defined (_MSC_VER)
    00131 #include <ymath.h>
    00132 #define OSNAN _Nan._Double
    00133 #else
    00134 #define OSNAN nanKludge() // wow, what a last resort, I don't like this!
    00135 #endif
    00136
    00137
    00138
    00139 inline bool OSIsnan(double x) {
    00140         //this is taken directly from COINUTILS
    00141 #ifdef MY_C_ISNAN
    00142
    00143     return MY_C_ISNAN( x)!=0;
    00144 #else
    00145     return false;
    00146 #endif
    00147
    00148 }
    00149
    00150
    00151
    00152
    00153
    00154 //#include <limits.h>
    00155 //#ifdef INFINITY //This is the definition in the ISO C99 standard.
    00156 //      #define OSINFINITY INFINITY
    00157 //#else
    00158 //      #define OSINFINITY 1e20
    00159 //#endif
    00160
    00161 //#define OSINFINITY 1e30
    00162
    00163
    00164
    00165 #ifdef DBL_MAX
    00166         #define OSDBL_MAX DBL_MAX
    00167 #elif defined HUGE_VAL
    00168         //#define OSDBL_MAX OSINFINITY
    00169         #define OSDBL_MAX HUGE_VAL
    00170 #else
    00171         #define OSDBL_MAX 1e37 // guaranteed to be representable as a double by ANSI standard
    00172 #endif
    00173
    00174
    00175 #ifdef INT_MAX
    00176 #define OSINT_MAX INT_MAX
    00177 #else
    00178 #define OSINT_MAX 2147483647
    00179 #endif
    00180
    00181 #ifndef XSLT_LOCATION
    00182 #define XSLT_LOCATION  OSSRCDIR;
    00183 #endif
    00184
    00185
    00186
    00187
    00188
    00189 inline std::string      getVersionInfo(){
    00190         ostringstream versionInfo;
    00191                 versionInfo << std::endl << std::endl;
    00192                 versionInfo << "Optimization Services Solver";
    00193                 versionInfo << std::endl;
    00194                 versionInfo << "Main Authors: Horand Gassmann, Jun Ma, and Kipp Martin";
    00195                 versionInfo << std::endl;
    00196                 versionInfo << "Distributed under the Eclipse Public License" ;
    00197                 versionInfo << std::endl;
    00198                 versionInfo << "OS Version: ";
    00199                 versionInfo << OS_VERSION;
    00200                 versionInfo << std::endl;
    00201                 versionInfo << "Build Date: ";
    00202                 versionInfo << __DATE__;
    00203                 versionInfo << std::endl;
    00204
    00205                 #ifdef OS_SVN_REV
    00206                         versionInfo << "SVN Version: ";
    00207                         versionInfo << OS_SVN_REV;
    00208                 #endif
    00209
    00210                 versionInfo << std::endl << std::endl;
    00211         return versionInfo.str() ;
    00212 }
    00213
    00214
    00215 #endif
    00216
    00217
    00218