OSParameters.cpp
Go to the documentation of this file.
1 /* $Id: OSParameters.cpp 4234 2011-07-29 12:45:13Z Gassmann $ */
17 #include "OSConfig.h"
18 #include "OSParameters.h"
19 
20 #include <cstdlib>
21 
22 #ifdef HAVE_CMATH
23 # include <cmath>
24 #else
25 # ifdef HAVE_MATH_H
26 # include <math.h>
27 # else
28 # error "don't have header file for math"
29 # endif
30 #endif
31 #ifdef HAVE_CFLOAT
32 # include <cfloat>
33 #else
34 # ifdef HAVE_FLOAT_H
35 # include <float.h>
36 # endif
37 #endif
38 #ifdef HAVE_CIEEEFP
39 # include <cieeefp>
40 #else
41 # ifdef HAVE_IEEEFP_H
42 # include <ieeefp.h>
43 # endif
44 #endif
45 
46 #include <sstream>
47 
48 using std::ostringstream;
49 
50 // this is taken directly from COINUTILS
51 bool OSIsnan(double x)
52 {
53 #ifdef COIN_C_ISNAN
54  return COIN_C_ISNAN( x)!=0;
55 #else
56  return (x != x);
57 #endif
58 }
59 
60 double OSNaN()
61 {
62 #ifdef OSNAN
63  return OSNAN;
64 #else
65  // wow, what a last resort, I don't like this!
66  double zero = 0.0;
67  return 0.0/zero;
68 #endif
69 }
70 
71 std::string OSgetVersionInfo()
72 {
73  ostringstream versionInfo;
74  versionInfo << std::endl << std::endl;
75  versionInfo << "Optimization Services Solver";
76  versionInfo << std::endl;
77  versionInfo << "Main Authors: Horand Gassmann, Jun Ma, and Kipp Martin";
78  versionInfo << std::endl;
79  versionInfo << "Distributed under the Eclipse Public License" ;
80  versionInfo << std::endl;
81 
82 // OS_VERSION is not an environment variable, so to inspect it requires a bit of care
83  ostringstream temp_version;
84  temp_version << OS_VERSION;
85 
86  versionInfo << "OS Version: ";
87  if (temp_version.str() == "trunk")
88  {
89  versionInfo << "trunk";
90 #ifdef OS_SVN_REV
91  versionInfo << std::endl;
92  versionInfo << "SVN Version: ";
93  versionInfo << OS_SVN_REV;
94 #endif
95  }
96  else
97  versionInfo << OS_VERSION;
98  versionInfo << std::endl;
99 
100  versionInfo << "Build Date: ";
101  versionInfo << __DATE__;
102 
103  versionInfo << std::endl << std::endl;
104  return versionInfo.str() ;
105 }
std::string OSgetVersionInfo()
#define OS_VERSION
double OSNaN()
returns the value for NaN used in OS
#define OSNAN
Definition: OSParameters.h:106
bool OSIsnan(double x)
checks whether a given double is NaN
void fint fint fint real fint real * x