cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cddefines.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef CDDEFINES_H_
5 #define CDDEFINES_H_
6 
7 #include "cdstd.h"
8 
9 #ifdef _MSC_VER
10 /* disable warning that conditional expression is constant, true or false in if */
11 # pragma warning( disable : 4127 )
12 /* we are not using MS foundation class */
13 # ifndef WIN32_LEAN_AND_MEAN
14 # define WIN32_LEAN_AND_MEAN
15 # endif
16 #endif
17 
18 #ifdef __clang__
19 // this would generate lots of warnings about mismatched tags in the STL valarray definition
20 #pragma clang diagnostic ignored "-Wmismatched-tags"
21 #endif
22 
23 /* these headers are needed by all files */
24 /*lint -e129 these resolve several issues pclint has with my system headers */
25 /*lint -e78 */
26 /*lint -e830 */
27 /*lint -e38 */
28 /*lint -e148 */
29 /*lint -e114 */
30 /*lint -e18 */
31 /*lint -e49 */
32 // C++ versions of C headers
33 #include <cstdio>
34 #include <cstdlib>
35 #include <cctype>
36 #ifdef _MSC_VER
37 // MSVC needs this before cmath in order provide numeric constants
38 // (M_PI etc.) defined by C99 but not C++ standards to date.
39 #define _USE_MATH_DEFINES
40 #endif
41 #include <cmath>
42 #include <cassert>
43 #include <cstring>
44 #include <cfloat>
45 #include <climits>
46 #include <ctime>
47 #if defined(__sun) && defined(__SUNPRO_CC)
48 // with Solaris Studio 12.2 under Sparc Solaris, csignal doesn't define sigaction...
49 #include <signal.h>
50 #else
51 #include <csignal>
52 #endif
53 // C++ headers
54 #include <limits>
55 #include <string>
56 #include <sstream>
57 #include <iomanip>
58 #include <vector>
59 #include <valarray>
60 #include <complex>
61 #include <map>
62 #include <memory>
63 #include <stdexcept>
64 #include <algorithm>
65 #include <fstream>
66 #include <bitset>
67 #ifdef DMALLOC
68 #include <dmalloc.h>
69 #endif
70 
71 // Workaround for Windows...
72 #if defined(_MSC_VER) && !defined(SYS_CONFIG)
73 #define SYS_CONFIG "cloudyconfig_vs.h"
74 #endif
75 
76 // platform specific configuration; generated by configure.sh
77 #ifdef SYS_CONFIG
78 #include SYS_CONFIG
79 #else
80 #include "cloudyconfig.h"
81 #endif
82 
83 // prevent problems on platforms with broken support (such as Mac homebrew g++)
84 #ifndef HAVE_AVX_INTRIN
85 #undef __AVX__
86 #endif
87 
88 #ifndef HAVE_FMA_INTRIN
89 #undef __FMA__
90 #endif
91 
92 #ifndef HAVE_AVX2_INTRIN
93 #undef __AVX2__
94 #endif
95 
96 #ifndef HAVE_AVX512F_INTRIN
97 #undef __AVX512F__
98 #endif
99 
100 #ifdef __AVX__
101 #include <immintrin.h>
102 #endif
103 
104 /*lint +e18 */
105 /*lint +e49 */
106 /*lint +e38 */
107 /*lint +e148 */
108 /*lint +e830 */
109 /*lint +e78 */
110 /*lint -e129 */
111 
112 using namespace std;
113 
114 #undef STATIC
115 #ifdef USE_GPROF
116 #define STATIC
117 #else
118 #define STATIC static
119 #endif
120 
121 #ifdef FLT_IS_DBL
122 typedef double realnum;
123 #else
124 typedef float realnum;
125 #endif
126 
127 typedef float sys_float;
128 // prevent explicit float's from creeping back into the code
129 #define float PLEASE_USE_REALNUM_NOT_FLOAT
130 
131 inline FILE *sys_fopen(const char *path, const char *mode)
132 {
133  return fopen( path, mode );
134 }
135 #define fopen PLEASE_USE_open_data_NOT_fopen
136 
137 //Compile-time assertion after Alexandrescu
138 template<bool> struct StaticAssertFailed;
139 template<> struct StaticAssertFailed<true> {};
140 #define STATIC_ASSERT(x) ((void)StaticAssertFailed< (x) == true >())
141 
142 typedef enum {
143  ES_SUCCESS=0, // everything went fine...
144  ES_FAILURE=1, // general failure exit
145  ES_WARNINGS, // warnings were present
146  ES_BOTCHES, // botched monitors were present
147  ES_CLOUDY_ABORT, // Cloudy aborted
148  ES_BAD_ASSERT, // an assert in the code failed
149  ES_BAD_ALLOC, // a memory allocation failed
150  ES_OUT_OF_RANGE, // an out-of-range exception was thrown
151  ES_DOMAIN_ERROR, // a vectorized math routine threw a domain error
152  ES_USER_INTERRUPT, // the user terminated Cloudy (with ^C)
153  ES_TERMINATION_REQUEST, // Cloudy received a termination request
154  ES_ILLEGAL_INSTRUCTION, // the CPU encountered an illegal instruction
155  ES_FP_EXCEPTION, // a floating point exception was caught
156  ES_SEGFAULT, // a segmentation fault occurred
157  ES_BUS_ERROR, // a bus error occurred
158  ES_UNKNOWN_SIGNAL, // an unknown signal was caught
159  ES_UNKNOWN_EXCEPTION, // an unknown exception was caught
160  ES_TOP // NB NB -- this should always be the last entry
161 } exit_type;
162 
163 // make sure the system definitions are on par with ours
164 // especially EXIT_FAILURE does not have a guaranteed value!
165 #undef EXIT_SUCCESS
166 #define EXIT_SUCCESS ES_SUCCESS
167 #undef EXIT_FAILURE
168 #define EXIT_FAILURE ES_FAILURE
169 
170 #ifdef BOUNDS_CHECK
171 #define lgBOUNDSCHECKVAL true
172 #else
173 #define lgBOUNDSCHECKVAL false
174 #endif
175 
176 /* make sure this is globally visible as well! */
177 /* This must be done at the start of every file, to ensure that policy
178  for FPE handling, etc., is guaranteed to be set up before the
179  construction of file-statics and globals. */
180 #include "cpu.h"
181 
182 //*************************************************************************
183 //
201 //
202 // This implementation has been obtained from Wikipedia
203 //
204 //*************************************************************************
205 
206 template<typename T> class Singleton
207 {
208 public:
209  static T& Inst()
210  {
211  static T instance; // assumes T has a protected default constructor
212  return instance;
213  }
214 };
215 
216 /**************************************************************************
217  *
218  * these are variables and pointers for output from the code, used everywhere
219  * declared extern here, and definition is in cddefines.cpp
220  *
221  **************************************************************************/
222 
227 class Output
228 {
229 public:
230  FILE *m_fp;
231  // Implicit conversion
232  Output(FILE* fp) : m_fp(fp) {}
233  FILE *fptr() const
234  {
235  return m_fp;
236  }
237 };
238 
239 extern FILE *ioQQQ;
240 
241 extern FILE *ioStdin;
242 
243 extern FILE *ioMAP;
244 
247 extern FILE* ioPrnErr;
248 
250 extern bool lgAbort;
251 
254 extern bool lgTestCodeCalled;
255 
258 extern bool lgTestCodeEnabled;
259 
262 extern bool lgPrnErr;
263 
266 extern long int nzone;
267 
269 extern double fnzone;
270 
273 extern long int iteration;
274 
281 extern const double ZeroNum;
282 
283 /**************************************************************************
284  *
285  * these are constants used to dimension several vectors and index arrays
286  *
287  **************************************************************************/
288 
293 const int FILENAME_PATH_LENGTH = 200;
294 
297 
301 const int INPUT_LINE_LENGTH = 2000;
302 
304 const int NCHLAB = 20;
305 
308 const int LIMELM = 30;
309 
311 const int NISO = 2;
312 
316 const int NHYDRO_MAX_LEVEL = 401;
317 
319 const double MAX_DENSITY = 1.e24;
320 
322 const double DEPTH_OFFSET = 1.e-30;
323 
324 enum {CHARS_SPECIES=10};
325 enum {CHARS_ISOTOPE_SYM = 6};
326 
327 /* indices within recombination coefficient array */
328 /* ipRecEsc is state specific escape probability*/
329 const int ipRecEsc = 2;
330 /* the net escaping, including destruction by background and optical deepth*/
331 const int ipRecNetEsc = 1;
332 /* ipRecRad is state specific radiative recombination rate*/
333 const int ipRecRad = 0;
338 /* these specify the form of the line redistribution function */
339 /* partial redistribution with wings */
340 const int ipPRD = 1;
341 /* complete redistribution, core only, no wings, Hummer's K2 function */
342 const int ipCRD = -1;
343 /* complete redistribution with wings */
344 const int ipCRDW = 2;
345 /* redistribution function for Lya, calls Hummer routine for H-like series only */
346 const int ipLY_A = -2;
347 
349 const int ipHYDROGEN = 0;
350 const int ipHELIUM = 1;
351 const int ipLITHIUM = 2;
352 const int ipBERYLLIUM = 3;
353 const int ipBORON = 4;
354 const int ipCARBON = 5;
355 const int ipNITROGEN = 6;
356 const int ipOXYGEN = 7;
357 const int ipFLUORINE = 8;
358 const int ipNEON = 9;
359 const int ipSODIUM = 10;
360 const int ipMAGNESIUM = 11;
361 const int ipALUMINIUM = 12;
362 const int ipSILICON = 13;
363 const int ipPHOSPHORUS = 14;
364 const int ipSULPHUR = 15;
365 const int ipCHLORINE = 16;
366 const int ipARGON = 17;
367 const int ipPOTASSIUM = 18;
368 const int ipCALCIUM = 19;
369 const int ipSCANDIUM = 20;
370 const int ipTITANIUM = 21;
371 const int ipVANADIUM = 22;
372 const int ipCHROMIUM = 23;
373 const int ipMANGANESE = 24;
374 const int ipIRON = 25;
375 const int ipCOBALT = 26;
376 const int ipNICKEL = 27;
377 const int ipCOPPER = 28;
378 const int ipZINC = 29;
379 const int ipKRYPTON = 35;
380 
381 /***************************************************************************
382  * the following are prototypes for some routines that are part of the
383  * debugging process - they come and go in any particular sub.
384  * it is not necessary to declare them when used since they are defined here
385  **************************************************************************/
386 
395 double fudge(long int ipnt);
396 
400 void broken(void);
401 
404 void fixit_base(const char* func, const char* file, int line,
405  const char *reason);
406 
407 class Fixit
408 {
409 public:
410  Fixit(const char* func, const char* file, int line,
411  const char *reason)
412  {
413  fixit_base(func,file,line,reason);
414  }
415 };
416 
417 #define fixit(a) \
418  do { \
419  static Fixit fixit_s(__func__,__FILE__,__LINE__, (a)); \
420  } while (0)
421 
423 void CodeReview(void);
424 
426 void TestCode(void);
427 
433 void *MyMalloc(size_t size, const char *file, int line);
434 
439 void MyAssert(const char *file, int line, const char *comment);
440 
443 
445 {
446  const char* p_routine;
447  const char* p_file;
448  long p_line;
450 public:
451  cloudy_exit(const char* routine, const char* file, long line, exit_type exit_code)
452  {
453  p_routine = routine;
454  p_file = file;
455  p_line = line;
456  p_exit = exit_code;
457  }
458  virtual ~cloudy_exit() throw()
459  {
460  p_routine = NULL;
461  p_file = NULL;
462  }
463  const char* routine() const throw()
464  {
465  return p_routine;
466  }
467  const char* file() const throw()
468  {
469  return p_file;
470  }
471  long line() const
472  {
473  return p_line;
474  }
476  {
477  return p_exit;
478  }
479 };
480 
481 // workarounds for __func__ are defined in cpu.h
482 #define cdEXIT( FAIL ) throw cloudy_exit( __func__, __FILE__, __LINE__, FAIL )
483 
484 // calls like puts( "[Stop in MyRoutine]" ) have been integrated in cdEXIT above
485 #define puts( STR ) Using_puts_before_cdEXIT_is_no_longer_needed
486 
488 void ShowMe(void);
489 
491 NORETURN void TotalInsanity(void);
492 
493 /* TotalInsanityAsStub always calls TotalInsanity(), but in such a way that
494  * it can be used as a stub for another routine without generating warnings
495  * about unreachable code after the stub. Hence this should NOT be NORETURN */
496 template<class T>
498 {
499  // this is always true...
500  if( ZeroNum == 0. )
501  TotalInsanity();
502  else
503  return T();
504 }
505 
507 NORETURN void BadRead(void);
508 
512 int dbg_printf(int debug, const char *fmt, ...);
513 
515 int dprintf(FILE *fp, const char *format, ...);
516 
518 int fprintf (const Output& stream, const char *format, ...);
519 
520 int dprintf(const Output & stream, const char *format, ...);
521 
530 char *read_whole_line( char *chLine , int nChar , FILE *ioIN );
531 
532 /**************************************************************************
533  *
534  * various macros used by the code
535  *
536  **************************************************************************/
537 
541 #ifndef NDEBUG
542 # define DEBUG
543 #else
544 # undef DEBUG
545 #endif
546 
548 #if defined(malloc)
549 /* ...but if malloc is a macro, assume it is instrumented by a memory debugging tool
550  * (e.g. dmalloc) */
551 # define MALLOC(exp) (malloc(exp))
552 #else
553 /* Otherwise instrument and protect it ourselves */
554 # define MALLOC(exp) (MyMalloc(exp, __FILE__, __LINE__))
555 #endif
556 
558 {
559  int p_sig;
560 public:
561  explicit bad_signal(int sig)
562  {
563  p_sig = sig;
564  }
565  virtual ~bad_signal() throw() {}
566  int sig() const throw()
567  {
568  return p_sig;
569  }
570 };
571 
573 {
574  const char* p_file;
575  long p_line;
576  const char* p_comment;
577 public:
578  bad_assert(const char* file, long line, const char* comment);
579  void print(void) const
580  {
581  fprintf(ioQQQ,"DISASTER Assertion failure at %s:%ld\n%s\n",
582  p_file, p_line, p_comment);
583  }
584  virtual ~bad_assert() throw()
585  {
586  p_file = NULL;
587  }
588  const char* file() const throw()
589  {
590  return p_file;
591  }
592  long line() const throw()
593  {
594  return p_line;
595  }
596  const char *comment() const throw()
597  {
598  return p_comment;
599  }
600 };
601 
602 /* the do { ... } while ( 0 ) construct prevents bugs in code like this:
603  * if( test )
604  * ASSERT( n == 10 );
605  * else
606  * do something else...
607  */
608 #undef ASSERT
609 #ifndef OLD_ASSERT
610 # if NDEBUG
611 # define ASSERT(exp) ((void)0)
612 # else
613 # define ASSERT(exp) \
614  do { \
615  if (UNLIKELY(!(exp))) \
616  { \
617  bad_assert aa(__FILE__,__LINE__,"Failed: " #exp); \
618  if( cpu.i().lgAssertAbort() ) \
619  { \
620  aa.print(); \
621  abort(); \
622  } \
623  else \
624  throw aa; \
625  } \
626  } while( 0 )
627 # endif
628 #else
629 
630 # ifdef NDEBUG
631 # define ASSERT(exp) ((void)0)
632 # else
633 # define ASSERT(exp) \
634  do { \
635  if (!(exp)) \
636  MyAssert(__FILE__, __LINE__, "Failed: " #exp); \
637  } while( 0 )
638 # endif
639 #endif
640 
641 #define MESSAGE_ASSERT(msg, exp) ASSERT( (msg) ? (exp) : false )
642 
643 inline NORETURN void OUT_OF_RANGE(const char* str)
644 {
645  if( cpu.i().lgAssertAbort() )
646  abort();
647  else
648  throw out_of_range( str );
649 }
650 
651 #ifdef __SUNPRO_CC
652 #pragma does_not_return(OUT_OF_RANGE)
653 #endif
654 
655 /* Windows does not define isnan */
656 /* use our version on all platforms since the isnanf
657  * function does not exist under Solaris 9 either */
658 #undef isnan
659 #define isnan MyIsnan
660 
663 class t_debug : public Singleton<t_debug>
664 {
665  friend class Singleton<t_debug>;
666  FILE *p_fp;
668 protected:
669  t_debug() : p_fp(stderr)
670  {
671  p_callLevel = 0;
672  }
673 public:
674  void enter(const char *name)
675  {
676  ++p_callLevel;
677  fprintf(p_fp,"%*c%s\n",p_callLevel,'>',name);
678  }
679  void leave(const char *name)
680  {
681  fprintf(p_fp,"%*c%s\n",p_callLevel,'<',name);
682  --p_callLevel;
683  }
684 };
685 
688 class t_nodebug : public Singleton<t_nodebug>
689 {
690  friend class Singleton<t_nodebug>;
691 protected:
693 public:
694  void enter(const char *) const {}
695  void leave(const char *) const {}
696 };
697 
698 template<class Trace>
700 {
701  const char *p_name;
702 public:
703  explicit debugtrace(const char *funcname)
704  {
705  p_name = funcname;
706  Trace::Inst().enter(p_name);
707  }
709  {
710  Trace::Inst().leave(p_name);
711  p_name = NULL;
712  }
713  const char* name() const
714  {
715  return p_name;
716  }
717 };
718 
719 #ifdef DEBUG_FUN
720 #define DEBUG_ENTRY( funcname ) debugtrace<t_debug> DEBUG_ENTRY( funcname )
721 #else
722 #ifdef HAVE_FUNC
723 #define DEBUG_ENTRY( funcname ) ((void)0)
724 #else
725 #define DEBUG_ENTRY( funcname ) debugtrace<t_nodebug> DEBUG_ENTRY( funcname )
726 #endif
727 #endif
728 
729 // overload the character manipulation routines
730 inline char tolower(char c)
731 {
732  return static_cast<char>( tolower( static_cast<int>(c) ) );
733 }
734 inline unsigned char tolower(unsigned char c)
735 {
736  return static_cast<unsigned char>( tolower( static_cast<int>(c) ) );
737 }
738 
739 inline char toupper(char c)
740 {
741  return static_cast<char>( toupper( static_cast<int>(c) ) );
742 }
743 inline unsigned char toupper(unsigned char c)
744 {
745  return static_cast<unsigned char>( toupper( static_cast<int>(c) ) );
746 }
747 
748 /* TorF(l) returns a 'T' or 'F' depending on the 'logical' expr 'l' */
749 inline char TorF( bool l ) { return l ? 'T' : 'F'; }
750 /* */
751 
753 inline bool is_odd( int j ) { return (j&1) == 1; }
754 inline bool is_odd( long j ) { return (j&1L) == 1L; }
755 /* */
756 
758 inline long nint( double x ) { return static_cast<long>( (x < 0.) ? x-0.5 : x+0.5 ); }
759 /* */
760 
761 /* define min for mixed arguments, the rest already exists */
762 inline long min( int a, long b ) { long c = a; return ( (c < b) ? c : b ); }
763 inline long min( long a, int b ) { long c = b; return ( (a < c) ? a : c ); }
764 inline double min( sys_float a, double b ) { double c = a; return ( (c < b) ? c : b ); }
765 inline double min( double a, sys_float b ) { double c = b; return ( (a < c) ? a : c ); }
766 
767 /* want to define this only if no native os support exists */
768 #ifndef HAVE_POWI
769 
770 double powi( double , long int );
771 #endif
772 
774 double powpq(double x, int p, int q);
775 
776 /* avoid ambiguous overloads */
777 #ifndef HAVE_POW_DOUBLE_INT
778 inline double pow( double x, int i ) { return powi( x, long(i) ); }
779 #endif
780 
781 #ifndef HAVE_POW_DOUBLE_LONG
782 inline double pow( double x, long i ) { return powi( x, i ); }
783 #endif
784 
785 #ifndef HAVE_POW_FLOAT_INT
786 inline sys_float pow( sys_float x, int i ) { return sys_float( powi( double(x), long(i) ) ); }
787 #endif
788 
789 #ifndef HAVE_POW_FLOAT_LONG
790 inline sys_float pow( sys_float x, long i ) { return sys_float( powi( double(x), i ) ); }
791 #endif
792 
793 #ifndef HAVE_POW_FLOAT_DOUBLE
794 inline double pow( sys_float x, double y ) { return pow( double(x), y ); }
795 #endif
796 
797 #ifndef HAVE_POW_DOUBLE_FLOAT
798 inline double pow( double x, sys_float y ) { return pow( x, double(y) ); }
799 #endif
800 
801 #undef MIN2
802 
803 #define MIN2(a,b) min(a,b)
804 /* */
805 
806 #undef MIN3
807 
808 #define MIN3(a,b,c) (min(min(a,b),c))
809 /* */
810 
811 #undef MIN4
812 
813 #define MIN4(a,b,c,d) (min(min(a,b),min(c,d)))
814 /* */
815 
816 /* define max for mixed arguments, the rest already exists */
817 inline long max( int a, long b ) { long c = a; return ( (c > b) ? c : b ); }
818 inline long max( long a, int b ) { long c = b; return ( (a > c) ? a : c ); }
819 inline double max( sys_float a, double b ) { double c = a; return ( (c > b) ? c : b ); }
820 inline double max( double a, sys_float b ) { double c = b; return ( (a > c) ? a : c ); }
821 
822 #undef MAX2
823 
824 #define MAX2(a,b) max(a,b)
825 /* */
826 
827 #undef MAX3
828 
829 #define MAX3(a,b,c) (max(max(a,b),c))
830 /* */
831 
832 #undef MAX4
833 
834 #define MAX4(a,b,c,d) (max(max(a,b),max(c,d)))
835 /* */
836 
841 template<class T>
842 inline T sign( T x, T y )
843 {
844  return ( y < T() ) ? -abs(x) : abs(x);
845 }
846 /* */
847 
849 template<class T>
850 inline int sign3( T x ) { return ( x < T() ) ? -1 : ( ( x > T() ) ? 1 : 0 ); }
851 /* */
852 
854 inline bool fp_equal( sys_float x, sys_float y, int n=3 )
855 {
856 #ifdef _MSC_VER
857  /* disable warning that conditional expression is constant, true or false in if */
858 # pragma warning( disable : 4127 )
859 #endif
860  ASSERT( n >= 1 );
861  // mimic IEEE behavior
862  if( isnan(x) || isnan(y) )
863  return false;
864  int sx = sign3(x);
865  int sy = sign3(y);
866  // treat zero cases first to avoid division by zero below
867  if( sx == 0 && sy == 0 )
868  return true;
869  // either x or y is zero (but not both), or x and y have different sign
870  if( sx*sy != 1 )
871  return false;
872  x = abs(x);
873  y = abs(y);
874  // adjust epsilon value for denormalized numbers
875  int exp;
876  (void)frexp(max(x,y), &exp);
877  sys_float epsilon = ldexp(FLT_EPSILON, max(0,FLT_MIN_EXP-exp));
878  return ( 1.f - min(x,y)/max(x,y) < ((sys_float)n+0.1f)*epsilon );
879 }
880 
881 inline bool fp_equal( double x, double y, int n=3 )
882 {
883  ASSERT( n >= 1 );
884  // mimic IEEE behavior
885  if( isnan(x) || isnan(y) )
886  return false;
887  int sx = sign3(x);
888  int sy = sign3(y);
889  // treat zero cases first to avoid division by zero below
890  if( sx == 0 && sy == 0 )
891  return true;
892  // either x or y is zero (but not both), or x and y have different sign
893  if( sx*sy != 1 )
894  return false;
895  x = abs(x);
896  y = abs(y);
897  // adjust epsilon value for denormalized numbers
898  int exp;
899  (void)frexp(max(x,y), &exp);
900  double epsilon = ldexp(DBL_EPSILON, max(0,DBL_MIN_EXP-exp));
901  return ( 1. - min(x,y)/max(x,y) < ((double)n+0.1)*epsilon );
902 }
903 
904 inline bool fp_equal_tol( sys_float x, sys_float y, sys_float tol )
905 {
906  ASSERT( tol > 0.f );
907  // mimic IEEE behavior
908  if( isnan(x) || isnan(y) )
909  return false;
910  // make sure the tolerance is not too stringent
911  ASSERT( tol >= FLT_EPSILON*max(abs(x),abs(y)) );
912  return ( abs( x-y ) <= tol );
913 }
914 
915 inline bool fp_equal_tol( double x, double y, double tol )
916 {
917  ASSERT( tol > 0. );
918  // mimic IEEE behavior
919  if( isnan(x) || isnan(y) )
920  return false;
921  // make sure the tolerance is not too stringent
922  ASSERT( tol >= DBL_EPSILON*max(abs(x),abs(y)) );
923  return ( abs( x-y ) <= tol );
924 }
925 
927 inline bool fp_bound( sys_float lo, sys_float x, sys_float hi, int n=3 )
928 {
929  ASSERT( n >= 1 );
930  // mimic IEEE behavior
931  if( isnan(x) || isnan(lo) || isnan(hi) )
932  return false;
933  if( fp_equal(lo,hi,n) )
934  return fp_equal(0.5f*(lo+hi),x,n);
935  if( ((hi-x)/(hi-lo))*((x-lo)/(hi-lo)) < -((sys_float)n+0.1f)*FLT_EPSILON )
936  return false;
937  return true;
938 }
939 inline bool fp_bound( double lo, double x, double hi, int n=3 )
940 {
941  ASSERT( n >= 1 );
942  // mimic IEEE behavior
943  if( isnan(x) || isnan(lo) || isnan(hi) )
944  return false;
945  if( fp_equal(lo,hi,n) )
946  return fp_equal(0.5*(lo+hi),x,n);
947  if( ((hi-x)/(hi-lo))*((x-lo)/(hi-lo)) < -((double)n+0.1)*DBL_EPSILON )
948  return false;
949  return true;
950 }
951 inline bool fp_bound_tol( sys_float lo, sys_float x, sys_float hi, sys_float tol )
952 {
953  ASSERT( tol > 0.f );
954  // mimic IEEE behavior
955  if( isnan(x) || isnan(lo) || isnan(hi) )
956  return false;
957  if( fp_equal_tol(lo,hi,tol) )
958  return fp_equal_tol(0.5f*(lo+hi),x,tol);
959  if( ((hi-x)/(hi-lo))*((x-lo)/(hi-lo)) < -tol )
960  return false;
961  return true;
962 }
963 inline bool fp_bound_tol( double lo, double x, double hi, double tol )
964 {
965  ASSERT( tol > 0. );
966  // mimic IEEE behavior
967  if( isnan(x) || isnan(lo) || isnan(hi) )
968  return false;
969  if( fp_equal_tol(lo,hi,tol) )
970  return fp_equal_tol(0.5*(lo+hi),x,tol);
971  if( ((hi-x)/(hi-lo))*((x-lo)/(hi-lo)) < -tol )
972  return false;
973  return true;
974 }
975 
976 
977 #undef POW2
978 
979 #define POW2 pow2
980 template<class T>
981 inline T pow2(T a) { return a*a; }
982 /* */
983 
984 #undef POW3
985 
986 #define POW3 pow3
987 template<class T>
988 inline T pow3(T a) { return a*a*a; }
989 /* */
990 
991 #undef POW4
992 
993 #define POW4 pow4
994 template<class T>
995 inline T pow4(T a) { T b = a*a; return b*b; }
996 /* */
997 
998 #undef SDIV
999 
1002 inline sys_float SDIV( sys_float x ) { return ( fabs((double)x) < (double)SMALLFLOAT ) ? (sys_float)SMALLFLOAT : x; }
1003 /* \todo should we use SMALLDOUBLE here ? it produces overflows now... PvH */
1004 inline double SDIV( double x ) { return ( fabs(x) < (double)SMALLFLOAT ) ? (double)SMALLFLOAT : x; }
1005 // inline double SDIV( double x ) { return ( fabs(x) < SMALLDOUBLE ) ? SMALLDOUBLE : x; }
1006 /* */
1007 
1012 {
1013  // this should crash...
1014  if( isnan(x) || isnan(y) )
1015  return x/y;
1016  int sx = sign3(x);
1017  int sy = sign3(y);
1018  // 0/0 -> NaN, this should crash as well...
1019  if( sx == 0 && sy == 0 )
1020  {
1021  if( isnan(res_0by0) )
1022  return x/y;
1023  else
1024  return res_0by0;
1025  }
1026  if( sx == 0 )
1027  return 0.;
1028  if( sy == 0 )
1029  return ( sx < 0 ) ? -FLT_MAX : FLT_MAX;
1030  // at this stage x != 0. and y != 0.
1031  sys_float ay = abs(y);
1032  if( ay >= 1.f )
1033  return x/y;
1034  else
1035  {
1036  // multiplication is safe since ay < 1.
1037  if( abs(x) < ay*FLT_MAX )
1038  return x/y;
1039  else
1040  return ( sx*sy < 0 ) ? -FLT_MAX : FLT_MAX;
1041  }
1042 }
1043 
1045 {
1046  return safe_div( x, y, numeric_limits<sys_float>::quiet_NaN() );
1047 }
1048 
1052 inline double safe_div(double x, double y, double res_0by0)
1053 {
1054  // this should crash...
1055  if( isnan(x) || isnan(y) )
1056  return x/y;
1057  int sx = sign3(x);
1058  int sy = sign3(y);
1059  // 0/0 -> NaN, this should crash as well...
1060  if( sx == 0 && sy == 0 )
1061  {
1062  if( isnan(res_0by0) )
1063  return x/y;
1064  else
1065  return res_0by0;
1066  }
1067  if( sx == 0 )
1068  return 0.;
1069  if( sy == 0 )
1070  return ( sx < 0 ) ? -DBL_MAX : DBL_MAX;
1071  // at this stage x != 0. and y != 0.
1072  double ay = abs(y);
1073  if( ay >= 1. )
1074  return x/y;
1075  else
1076  {
1077  // multiplication is safe since ay < 1.
1078  if( abs(x) < ay*DBL_MAX )
1079  return x/y;
1080  else
1081  return ( sx*sy < 0 ) ? -DBL_MAX : DBL_MAX;
1082  }
1083 }
1084 
1085 inline double safe_div(double x, double y)
1086 {
1087  return safe_div( x, y, numeric_limits<double>::quiet_NaN() );
1088 }
1089 
1090 template<class T>
1091 inline void invalidate_array(T* p, size_t size)
1092 {
1093  if( size > 0 )
1094  memset( p, -1, size );
1095 }
1096 
1097 inline void invalidate_array(double* p, size_t size)
1098 {
1099  set_NaN( p, (long)(size/sizeof(double)) );
1100 }
1101 
1102 inline void invalidate_array(sys_float* p, size_t size)
1103 {
1104  set_NaN( p, (long)(size/sizeof(sys_float)) );
1105 }
1106 
1109 template<class T> inline T* get_ptr(T *v)
1110 {
1111  return v;
1112 }
1113 template<class T> inline T* get_ptr(valarray<T> &v)
1114 {
1115  return &v[0];
1116 }
1117 template<class T, class U> inline T* get_ptr(vector<T,U> &v)
1118 {
1119  return &v[0];
1120 }
1121 template<class T> inline const T* get_ptr(const valarray<T> &v)
1122 {
1123  return const_cast<const T*>(&const_cast<valarray<T>&>(v)[0]);
1124 }
1125 template<class T, class U> inline const T* get_ptr(const vector<T,U> &v)
1126 {
1127  return const_cast<const T*>(&const_cast<vector<T,U>&>(v)[0]);
1128 }
1129 
1155 template<class T>
1157 {
1158  T* ptr;
1159 
1160  template<class U>
1162  {
1163  U* ptr;
1164 
1165  explicit auto_vec_ref( U* p )
1166  {
1167  ptr = p;
1168  }
1169  };
1170 
1171 public:
1172  typedef T element_type;
1173 
1174  // 20.4.5.1 construct/copy/destroy:
1175 
1176  explicit auto_vec( element_type* p = NULL ) throw()
1177  {
1178  ptr = p;
1179  }
1180  auto_vec( auto_vec& p ) throw()
1181  {
1182  ptr = p.release();
1183  }
1184  auto_vec& operator= ( auto_vec& p ) throw()
1185  {
1186  reset( p.release() );
1187  return *this;
1188  }
1189  ~auto_vec() throw()
1190  {
1191  delete[] ptr;
1192  }
1193 
1194  // 20.4.5.2 members:
1195 
1196  element_type& operator[] ( ptrdiff_t n ) const throw()
1197  {
1198  return *(ptr+n);
1199  }
1200  element_type* get() const throw()
1201  {
1202  return ptr;
1203  }
1204  // for consistency with other container classes
1205  element_type* data() const throw()
1206  {
1207  return ptr;
1208  }
1210  {
1211  element_type* p = ptr;
1212  ptr = NULL;
1213  return p;
1214  }
1215  void reset( element_type* p = NULL ) throw()
1216  {
1217  if( p != ptr )
1218  {
1219  delete[] ptr;
1220  ptr = p;
1221  }
1222  }
1223 
1224  // 20.4.5.3 conversions:
1225 
1227  {
1228  ptr = r.ptr;
1229  }
1230  auto_vec& operator= ( auto_vec_ref<element_type> r ) throw()
1231  {
1232  if( r.ptr != ptr )
1233  {
1234  delete[] ptr;
1235  ptr = r.ptr;
1236  }
1237  return *this;
1238  }
1239  operator auto_vec_ref<element_type>() throw()
1240  {
1241  return auto_vec_ref<element_type>( this->release() );
1242  }
1243 };
1244 
1250 double csphot(long int inu, long int ithr, long int iofset);
1251 
1256 double RandGauss(double xMean, double s );
1257 
1261 double MyGaussRand( double PctUncertainty );
1262 
1264 double AnuUnit(realnum energy);
1265 
1270 void cap4(char *chCAP , const char *chLab);
1271 
1274 void uncaps(char *chCard );
1275 
1278 void caps(char *chCard );
1279 
1286 double FFmtRead(const char *chCard,
1287  long int *ipnt,
1288  long int last,
1289  bool *lgEOL);
1290 
1296 long nMatch(const char *chKey,
1297  const char *chCard);
1298 
1299 // these are safe versions of strstr, strchr, etc to work around a deficiency in glibc
1300 inline const char *strstr_s(const char *haystack, const char *needle)
1301 {
1302  return const_cast<const char *>(strstr(haystack, needle));
1303 }
1304 
1305 inline char *strstr_s(char *haystack, const char *needle)
1306 {
1307  return const_cast<char *>(strstr(haystack, needle));
1308 }
1309 
1310 inline const char *strchr_s(const char *s, int c)
1311 {
1312  return const_cast<const char *>(strchr(s, c));
1313 }
1314 
1315 inline char *strchr_s(char *s, int c)
1316 {
1317  return const_cast<char *>(strchr(s, c));
1318 }
1319 
1322 long int ipow( long, long );
1323 
1324 // this routine is fully equivalent to snprintf() apart from the fact that it
1325 // concatenates the output to an existing string rather than replacing it.
1326 size_t sncatf( char* buf, size_t bufSize, const char* fmt, ... );
1327 
1328 size_t sncatf( ostringstream& buf, const char* fmt, ... );
1329 
1332 void PrintE82( FILE*, double );
1333 
1335 void PrintE71( FILE*, double );
1336 
1338 void PrintE93( FILE*, double );
1339 
1345 // prevent compiler warnings on non-MS systems
1346 #ifdef _MSC_VER
1347 char *PrintEfmt(const char *fmt, double val );
1348 #else
1349 #define PrintEfmt( F, V ) F, V
1350 #endif
1351 
1353 const double SEXP_LIMIT = 84.;
1355 const double DSEXP_LIMIT = 680.;
1356 
1359 double sexp(double x);
1360 
1365 double dsexp(double x);
1366 
1368 inline double exp10(double x)
1369 {
1370  if( x < -330. )
1371  return 0.;
1372  else if( x > 310. )
1373  return pow2(BIGDOUBLE); // +Inf
1374  else
1375  {
1376  double y = trunc(x/3.);
1377  double z = 3.*y;
1378  x -= z;
1379  x *= 2.302585092994045684; // constant is ln(10)
1380  x -= 7.90550887243868070612e-3*z; // constant is ln(10)-10/3*ln(2)
1381  return ldexp(exp(x),10*int(y));
1382  }
1383 }
1384 
1387 {
1388  if( x < -50.f )
1389  return 0.f;
1390  else if( x > 40.f )
1391  return pow2(BIGFLOAT); // +Inf
1392  else
1393  {
1394  sys_float y = truncf(x/3.f);
1395  sys_float z = 3.f*y;
1396  x -= z;
1397  x *= 2.302585093f; // constant is ln(10)
1398  x -= 7.9055088724e-3f*z; // constant is ln(10)-10/3*ln(2)
1399  return ldexpf(expf(x),10*int(y));
1400  }
1401 }
1402 
1404 {
1405  return exp10f(x);
1406 }
1407 
1412 double plankf(long int ip);
1413 
1414 // safe version of getline() that correctly handles all types of EOL lf, crlf and cr...
1415 istream& SafeGetline(istream& is, string& t);
1416 
1426 void spsort( realnum x[], long int n, long int iperm[], int kflag, int *ier);
1427 
1428 /**************************************************************************
1429  *
1430  * disable some bogus errors in the ms c compiler
1431  *
1432  **************************************************************************/
1433 
1434 /* */
1435 #ifdef _MSC_VER
1436  /* disable warning that conditional expression is constant, true or false in if */
1437 # pragma warning( disable : 4127 )
1438  /* disable strcat warning */
1439 # pragma warning( disable : 4996 )
1440  /* disable bogus underflow warning in MS VS*/
1441 # pragma warning( disable : 4056 )
1442  /* disable "inline function removed since not used", MS VS*/
1443 # pragma warning( disable : 4514 )
1444  /* disable "assignment operator could not be generated", cddefines.h
1445  * line 126 */
1446 # pragma warning( disable : 4512 )
1447 #endif
1448 #ifdef __INTEL_COMPILER
1449 # pragma warning( disable : 1572 )
1450 #endif
1451 /* */
1452 
1453 /*lint +e129 these resolve several issues pclint has with my system headers */
1454 /*lint +e78 */
1455 /*lint +e830 */
1456 /*lint +e38 */
1457 /*lint +e148 */
1458 /*lint +e114 */
1459 /*lint +e18 */
1460 /*lint +e49 */
1461 
1462 #endif /* CDDEFINES_H_ */
1463 
const char * p_name
Definition: cddefines.h:701
T pow4(T a)
Definition: cddefines.h:995
FILE * ioMAP
Definition: cdinit.cpp:9
void leave(const char *name)
Definition: cddefines.h:679
const char * file() const
Definition: cddefines.h:588
const int ipBERYLLIUM
Definition: cddefines.h:352
void leave(const char *) const
Definition: cddefines.h:695
FILE * p_fp
Definition: cddefines.h:666
t_debug()
Definition: cddefines.h:669
void PrintE93(FILE *, double)
Definition: service.cpp:923
const int ipMAGNESIUM
Definition: cddefines.h:360
int p_callLevel
Definition: cddefines.h:667
bool is_odd(int j)
Definition: cddefines.h:753
virtual ~bad_signal()
Definition: cddefines.h:565
exit_type exit_status() const
Definition: cddefines.h:475
double exp10(double x)
Definition: cddefines.h:1368
const int FILENAME_PATH_LENGTH_2
Definition: cddefines.h:296
#define NORETURN
Definition: cpu.h:455
istream & SafeGetline(istream &is, string &t)
Definition: service.cpp:1823
T * get_ptr(T *v)
Definition: cddefines.h:1109
NORETURN void TotalInsanity(void)
Definition: service.cpp:971
const double BIGDOUBLE
Definition: cpu.h:249
void set_NaN(sys_float &x)
Definition: cpu.cpp:906
const int ipARGON
Definition: cddefines.h:366
const int ipTITANIUM
Definition: cddefines.h:370
const char * file() const
Definition: cddefines.h:467
const realnum SMALLFLOAT
Definition: cpu.h:246
t_cpu_i & i()
Definition: cpu.h:419
FILE * sys_fopen(const char *path, const char *mode)
Definition: cddefines.h:131
virtual ~cloudy_exit()
Definition: cddefines.h:458
const int NISO
Definition: cddefines.h:311
size_t sncatf(char *buf, size_t bufSize, const char *fmt,...)
Definition: service.cpp:716
const char * routine() const
Definition: cddefines.h:463
char TorF(bool l)
Definition: cddefines.h:749
const int ipOXYGEN
Definition: cddefines.h:356
const int ipCHLORINE
Definition: cddefines.h:365
#define PrintEfmt(F, V)
Definition: cddefines.h:1349
void enter(const char *) const
Definition: cddefines.h:694
void invalidate_array(T *p, size_t size)
Definition: cddefines.h:1091
long nMatch(const char *chKey, const char *chCard)
Definition: service.cpp:525
T sign(T x, T y)
Definition: cddefines.h:842
int sig() const
Definition: cddefines.h:566
const char * name() const
Definition: cddefines.h:713
bool fp_equal_tol(sys_float x, sys_float y, sys_float tol)
Definition: cddefines.h:904
T TotalInsanityAsStub()
Definition: cddefines.h:497
const char * strstr_s(const char *haystack, const char *needle)
Definition: cddefines.h:1300
void * MyMalloc(size_t size, const char *file, int line)
Definition: service.cpp:1643
sys_float sexp(sys_float x)
Definition: service.cpp:999
const int ipRecNetEsc
Definition: cddefines.h:331
long line() const
Definition: cddefines.h:592
int dbg_printf(int debug, const char *fmt,...)
Definition: service.cpp:1153
T pow3(T a)
Definition: cddefines.h:988
bad_signal(int sig)
Definition: cddefines.h:561
double fudge(long int ipnt)
Definition: service.cpp:555
const int ipCOBALT
Definition: cddefines.h:375
FILE * ioQQQ
Definition: cddefines.cpp:7
NORETURN void OUT_OF_RANGE(const char *str)
Definition: cddefines.h:643
long int nzone
Definition: cddefines.cpp:14
const int ipNICKEL
Definition: cddefines.h:376
const int ipZINC
Definition: cddefines.h:378
exit_type
Definition: cddefines.h:142
void cap4(char *chCAP, const char *chLab)
Definition: service.cpp:261
Output(FILE *fp)
Definition: cddefines.h:232
const char * p_file
Definition: cddefines.h:574
double dsexp(double x)
Definition: service.cpp:1038
void CodeReview(void)
Definition: service.cpp:1093
const int ipSULPHUR
Definition: cddefines.h:364
bool fp_bound_tol(sys_float lo, sys_float x, sys_float hi, sys_float tol)
Definition: cddefines.h:951
void fixit_base(const char *func, const char *file, int line, const char *reason)
Definition: service.cpp:1076
const double MAX_DENSITY
Definition: cddefines.h:319
static T & Inst()
Definition: cddefines.h:209
bool lgAssertAbort() const
Definition: cpu.h:385
void uncaps(char *chCard)
Definition: service.cpp:281
char toupper(char c)
Definition: cddefines.h:739
void print(void) const
Definition: cddefines.h:579
element_type * data() const
Definition: cddefines.h:1205
#define fopen
Definition: cddefines.h:135
long int iteration
Definition: cddefines.cpp:16
const double DSEXP_LIMIT
Definition: cddefines.h:1355
bool fp_equal(sys_float x, sys_float y, int n=3)
Definition: cddefines.h:854
void broken(void)
Definition: service.cpp:1067
debugtrace(const char *funcname)
Definition: cddefines.h:703
int dprintf(FILE *fp, const char *format,...)
Definition: service.cpp:1102
const int ipVANADIUM
Definition: cddefines.h:371
const int ipIRON
Definition: cddefines.h:374
void PrintE71(FILE *, double)
Definition: service.cpp:873
sys_float exp10f(sys_float x)
Definition: cddefines.h:1386
char tolower(char c)
Definition: cddefines.h:730
element_type * release()
Definition: cddefines.h:1209
double energy(const genericState &gs)
const char * p_routine
Definition: cddefines.h:446
const int ipSCANDIUM
Definition: cddefines.h:369
auto_vec(element_type *p=NULL)
Definition: cddefines.h:1176
Fixit(const char *func, const char *file, int line, const char *reason)
Definition: cddefines.h:410
const double ZeroNum
Definition: cdinit.cpp:13
const int ipCRD
Definition: cddefines.h:342
void enter(const char *name)
Definition: cddefines.h:674
FILE * m_fp
Definition: cddefines.h:230
virtual ~bad_assert()
Definition: cddefines.h:584
long p_line
Definition: cddefines.h:448
float realnum
Definition: cddefines.h:124
float sys_float
Definition: cddefines.h:127
const int ipLY_A
Definition: cddefines.h:346
const realnum BIGFLOAT
Definition: cpu.h:244
const int ipPHOSPHORUS
Definition: cddefines.h:363
const int INPUT_LINE_LENGTH
Definition: cddefines.h:301
long max(int a, long b)
Definition: cddefines.h:817
int sign3(T x)
Definition: cddefines.h:850
const char * p_file
Definition: cddefines.h:447
const int ipNEON
Definition: cddefines.h:358
const int ipCHROMIUM
Definition: cddefines.h:372
double powi(double, long int)
Definition: service.cpp:594
const int ipRecRad
Definition: cddefines.h:333
long min(int a, long b)
Definition: cddefines.h:762
bool fp_bound(sys_float lo, sys_float x, sys_float hi, int n=3)
Definition: cddefines.h:927
long p_line
Definition: cddefines.h:575
const char * strchr_s(const char *s, int c)
Definition: cddefines.h:1310
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
Definition: cddefines.h:1011
const int ipRecEsc
Definition: cddefines.h:329
exit_type p_exit
Definition: cddefines.h:449
double RandGauss(double xMean, double s)
Definition: service.cpp:1696
void reset(element_type *p=NULL)
Definition: cddefines.h:1215
const int ipKRYPTON
Definition: cddefines.h:379
double AnuUnit(realnum energy)
Definition: service.cpp:197
void MyAssert(const char *file, int line, const char *comment)
Definition: service.cpp:177
auto_vec(auto_vec &p)
Definition: cddefines.h:1180
bool lgTestCodeEnabled
Definition: cddefines.cpp:12
const int ipSILICON
Definition: cddefines.h:362
const char * comment() const
Definition: cddefines.h:596
long int ipow(long, long)
Definition: service.cpp:658
#define ASSERT(exp)
Definition: cddefines.h:613
FILE * fptr() const
Definition: cddefines.h:233
FILE * ioPrnErr
Definition: cddefines.cpp:9
const int ipALUMINIUM
Definition: cddefines.h:361
const char * p_comment
Definition: cddefines.h:576
const int ipCALCIUM
Definition: cddefines.h:368
const int ipNITROGEN
Definition: cddefines.h:355
double csphot(long int inu, long int ithr, long int iofset)
Definition: service.cpp:1655
const int LIMELM
Definition: cddefines.h:308
T pow2(T a)
Definition: cddefines.h:981
const int ipFLUORINE
Definition: cddefines.h:357
auto_vec(auto_vec_ref< element_type > r)
Definition: cddefines.h:1226
double powpq(double x, int p, int q)
Definition: service.cpp:630
#define isnan
Definition: cddefines.h:659
const int ipHELIUM
Definition: cddefines.h:350
const int ipMANGANESE
Definition: cddefines.h:373
long line() const
Definition: cddefines.h:471
bool lgTestCodeCalled
Definition: cddefines.cpp:11
const int NCHLAB
Definition: cddefines.h:304
const int FILENAME_PATH_LENGTH
Definition: cddefines.h:293
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
const int ipPRD
Definition: cddefines.h:340
sys_float SDIV(sys_float x)
Definition: cddefines.h:1002
bool lgPrnErr
Definition: cddefines.cpp:13
const int ipCARBON
Definition: cddefines.h:354
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
Definition: service.cpp:70
cloudy_exit(const char *routine, const char *file, long line, exit_type exit_code)
Definition: cddefines.h:451
long nint(double x)
Definition: cddefines.h:758
double MyGaussRand(double PctUncertainty)
Definition: service.cpp:1736
void caps(char *chCard)
Definition: service.cpp:295
static t_cpu cpu
Definition: cpu.h:427
double fnzone
Definition: cddefines.cpp:15
void ShowMe(void)
Definition: service.cpp:205
void PrintE82(FILE *, double)
Definition: service.cpp:824
const double SEXP_LIMIT
Definition: cddefines.h:1353
double plankf(long int ip)
Definition: service.cpp:1760
const int ipHYDROGEN
Definition: cddefines.h:349
const int ipLITHIUM
Definition: cddefines.h:351
void cdPrepareExit(exit_type)
Definition: cdinit.cpp:134
const double DEPTH_OFFSET
Definition: cddefines.h:322
void TestCode(void)
Definition: service.cpp:1057
const int ipPOTASSIUM
Definition: cddefines.h:367
const int NHYDRO_MAX_LEVEL
Definition: cddefines.h:316
NORETURN void BadRead(void)
Definition: service.cpp:986
T element_type
Definition: cddefines.h:1172
const int ipBORON
Definition: cddefines.h:353
bool lgAbort
Definition: cddefines.cpp:10
const int ipCRDW
Definition: cddefines.h:344
const int ipSODIUM
Definition: cddefines.h:359
void spsort(realnum x[], long int n, long int iperm[], int kflag, int *ier)
Definition: service.cpp:1222
FILE * ioStdin
Definition: cddefines.cpp:8
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
Definition: service.cpp:381
const int ipCOPPER
Definition: cddefines.h:377