source: nanovis/trunk/newmat11/include.h @ 4587

Last change on this file since 4587 was 2096, checked in by ldelgass, 9 years ago

Normalize line endings, set eol-style to native on *.cpp, *.h files

  • Property svn:eol-style set to native
File size: 7.6 KB
Line 
1/// \defgroup rbd_common RBD common library
2///@{
3
4/// \file include.h
5/// Set options and and details of include files.
6
7#ifndef INCLUDE_LIB
8#define INCLUDE_LIB
9
10//#define use_namespace                   // define name spaces
11
12//#define SETUP_C_SUBSCRIPTS              // allow element access via A[i][j]
13
14//#define OPT_COMPATIBLE                  // for use with opt++
15
16// Activate just one of the following 3 statements
17
18//#define SimulateExceptions              // use simulated exceptions
19#define UseExceptions                   // use C++ exceptions
20//#define DisableExceptions               // do not use exceptions
21
22
23//#define TEMPS_DESTROYED_QUICKLY         // for compilers that delete
24                                        // temporaries too quickly
25
26//#define TEMPS_DESTROYED_QUICKLY_R       // the same thing but applied
27                                        // to return from functions only
28
29//#define DO_FREE_CHECK                   // check news and deletes balance
30
31#define USING_DOUBLE                    // elements of type double
32//#define USING_FLOAT                   // elements of type float
33
34#define bool_LIB 0                      // for compatibility with my older libraries
35
36//#define ios_format_flags ios::fmtflags  // for Gnu 3 and Intel for Linux
37
38
39//#define _STANDARD_                    // using standard library
40
41//#define use_float_h                   // use float.h for precision data
42
43
44//#define HAS_INT64                     // if unsigned _int64 is recognised
45                                        // used by newran03
46                                       
47// comment out next line if Exception causes a problem
48#define TypeDefException
49
50//*********************** end of options set by user ********************
51
52
53// for Gnu C++ version 3
54#if defined __GNUG__ && __GNUG__ >= 3
55   #define _STANDARD_                   // use standard library
56   #define ios_format_flags ios::fmtflags
57#endif
58
59// for Intel C++ for Linux
60#if defined __ICC
61   #define _STANDARD_                   // use standard library
62   #define ios_format_flags ios::fmtflags
63#endif
64
65// for Microsoft Visual C++ 7 and above (and Intel simulating these)
66#if defined _MSC_VER && _MSC_VER >= 1300
67   #define _STANDARD_                   // use standard library
68#endif
69
70
71#ifdef _STANDARD_                       // using standard library
72   #include <cstdlib>
73   #if defined _MSC_VER && _MSC_VER == 1200
74      #include <limits>              // for VC++6
75   #endif
76   #ifdef WANT_STREAM
77      #include <iostream>
78      #include <iomanip>
79   #endif
80   #ifdef WANT_MATH
81      #include <cmath>
82   #endif
83   #ifdef WANT_STRING
84      #include <cstring>
85   #endif
86   #ifdef WANT_TIME
87      #include <ctime>
88   #endif
89   #ifdef WANT_FSTREAM
90      #include <fstream>
91   #endif
92   using namespace std;
93#else
94
95#define DEFAULT_HEADER                  // use AT&T style header
96                                        // if no other compiler is recognised
97
98#ifdef _MSC_VER                         // Microsoft
99   #include <stdlib.h>
100
101//   reactivate these statements to run under MSC version 7.0
102//   typedef int jmp_buf[9];
103//   extern "C"
104//   {
105//      int __cdecl setjmp(jmp_buf);
106//      void __cdecl longjmp(jmp_buf, int);
107//   }
108
109   #ifdef WANT_STREAM
110      #include <iostream.h>
111      #include <iomanip.h>
112   #endif
113   #ifdef WANT_MATH
114      #include <math.h>
115      #include <float.h>
116   #endif
117   #ifdef WANT_STRING
118      #include <string.h>
119   #endif
120   #ifdef WANT_TIME
121      #include <time.h>
122   #endif
123   #ifdef WANT_FSTREAM
124      #include <fstream.h>
125   #endif
126   #undef DEFAULT_HEADER
127#endif
128
129#ifdef __ZTC__                          // Zortech
130   #include <stdlib.h>
131   #ifdef WANT_STREAM
132      #include <iostream.hpp>
133      #include <iomanip.hpp>
134      #define flush ""                  // not defined in iomanip?
135   #endif
136   #ifdef WANT_MATH
137      #include <math.h>
138      #include <float.h>
139   #endif
140   #ifdef WANT_STRING
141      #include <string.h>
142   #endif
143   #ifdef WANT_TIME
144      #include <time.h>
145   #endif
146   #ifdef WANT_FSTREAM
147      #include <fstream.h>
148   #endif
149   #undef DEFAULT_HEADER
150#endif
151
152#if defined __BCPLUSPLUS__ || defined __TURBOC__  // Borland or Turbo
153   #include <stdlib.h>
154   #ifdef WANT_STREAM
155      #include <iostream.h>
156      #include <iomanip.h>
157   #endif
158   #ifdef WANT_MATH
159      #include <math.h>
160      #include <float.h>            // Borland has both float and values
161                                    // but values.h returns +INF for
162                                    // MAXDOUBLE in BC5
163   #endif
164   #ifdef WANT_STRING
165      #include <string.h>
166   #endif
167   #ifdef WANT_TIME
168      #include <time.h>
169   #endif
170   #ifdef WANT_FSTREAM
171      #include <fstream.h>
172   #endif
173   #undef DEFAULT_HEADER
174#endif
175
176#ifdef __GNUG__                         // Gnu C++
177   #include <stdlib.h>
178   #ifdef WANT_STREAM
179      #include <iostream.h>
180      #include <iomanip.h>
181   #endif
182   #ifdef WANT_MATH
183      #include <math.h>
184      #include <float.h>
185   #endif
186   #ifdef WANT_STRING
187      #include <string.h>
188   #endif
189   #ifdef WANT_TIME
190      #include <time.h>
191   #endif
192   #ifdef WANT_FSTREAM
193      #include <fstream.h>
194   #endif
195   #undef DEFAULT_HEADER
196#endif
197
198#ifdef __WATCOMC__                      // Watcom C/C++
199   #include <stdlib.h>
200   #ifdef WANT_STREAM
201      #include <iostream.h>
202      #include <iomanip.h>
203   #endif
204   #ifdef WANT_MATH
205      #include <math.h>
206      #include <float.h>
207   #endif
208   #ifdef WANT_STRING
209      #include <string.h>
210   #endif
211   #ifdef WANT_TIME
212      #include <time.h>
213   #endif
214   #ifdef WANT_FSTREAM
215      #include <fstream.h>
216   #endif
217   #undef DEFAULT_HEADER
218#endif
219
220
221#ifdef macintosh                        // MPW C++ on the Mac
222#include <stdlib.h>
223#ifdef WANT_STREAM
224#include <iostream.h>
225#include <iomanip.h>
226#endif
227#ifdef WANT_MATH
228#include <float.h>
229#include <math.h>
230#endif
231#ifdef WANT_STRING
232#include <string.h>
233#endif
234#ifdef WANT_TIME
235#include <time.h>
236#endif
237#ifdef WANT_FSTREAM
238#include <fstream.h>
239#endif
240#undef DEFAULT_HEADER
241#endif
242
243#ifdef use_float_h                      // use float.h for precision values
244#include <stdlib.h>
245#ifdef WANT_STREAM
246#include <iostream.h>
247#include <iomanip.h>
248#endif
249#ifdef WANT_MATH
250#include <float.h>
251#include <math.h>
252#endif
253#ifdef WANT_STRING
254#include <string.h>
255#endif
256#ifdef WANT_TIME
257#include <time.h>
258#endif
259#ifdef WANT_FSTREAM
260#include <fstream.h>
261#endif
262#undef DEFAULT_HEADER
263#endif
264
265
266#ifdef DEFAULT_HEADER                   // for example AT&T
267#define ATandT
268#include <stdlib.h>
269#ifdef WANT_STREAM
270#include <iostream.h>
271#include <iomanip.h>
272#endif
273#ifdef WANT_MATH
274#include <math.h>
275#define SystemV                         // use System V
276#include <values.h>
277#endif
278#ifdef WANT_STRING
279#include <string.h>
280#endif
281#ifdef WANT_TIME
282#include <time.h>
283#endif
284#ifdef WANT_FSTREAM
285#include <fstream.h>
286#endif
287#endif                                  // DEFAULT_HEADER
288
289#endif                                  // _STANDARD_
290
291#ifdef use_namespace
292namespace RBD_COMMON {
293#endif
294
295
296#ifdef USING_FLOAT                      // set precision type to float
297typedef float Real;
298typedef double long_Real;
299#endif
300
301#ifdef USING_DOUBLE                     // set precision type to double
302typedef double Real;
303typedef long double long_Real;
304#endif
305
306
307// This is for (very old) compilers that do not have bool automatically defined
308
309#ifndef bool_LIB
310#define bool_LIB 0
311
312class bool
313{
314        int value;
315public:
316        bool(const int b) { value = b ? 1 : 0; }
317        bool(const void* b) { value = b ? 1 : 0; }
318        bool() {}
319        operator int() const { return value; }
320        int operator!() const { return !value; }
321};
322
323
324const bool true = 1;
325const bool false = 0;
326
327#endif
328
329
330#ifdef use_namespace
331}
332#endif
333
334
335#ifdef use_namespace
336namespace RBD_COMMON {}
337namespace RBD_LIBRARIES                 // access all my libraries
338{
339   using namespace RBD_COMMON;
340}
341#endif
342
343
344#endif
345
346
347///@}
348
Note: See TracBrowser for help on using the repository browser.