Subversion Repositories public iLand

Rev

Rev 705 | Rev 707 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 705 Rev 706
Line 27... Line 27...
27
// conversions rad/degree
27
// conversions rad/degree
28
#define RAD(x) (x*M_PI/180.)
28
#define RAD(x) (x*M_PI/180.)
29
#define GRAD(x) (x/M_PI*180.)
29
#define GRAD(x) (x/M_PI*180.)
30
#define PI2 2*M_PI
30
#define PI2 2*M_PI
31
31
32
-
 
-
 
32
#include <cstdlib>
-
 
33
#include "math.h"
33
#include "exception.h"
34
#include "exception.h"
34
// general datatypes
35
// general datatypes
35
//typedef int TreeSpecies;
36
//typedef int TreeSpecies;
36
37
37
// global debug helpers (used by macros!)
38
// global debug helpers (used by macros!)
Line 74... Line 75...
74
bool logLevelWarning(); // true if only severe warnings/errors are logged.
75
bool logLevelWarning(); // true if only severe warnings/errors are logged.
75
void setLogLevel(int loglevel); // setter function
76
void setLogLevel(int loglevel); // setter function
76
// choose the random number generator:
77
// choose the random number generator:
77
// either:
78
// either:
78
// cool random number generator (using the mersenne-twister) by http://www-personal.umich.edu/~wagnerr/MersenneTwister.html
79
// cool random number generator (using the mersenne-twister) by http://www-personal.umich.edu/~wagnerr/MersenneTwister.html
79
// #include "../3rdparty/MersenneTwister.h"
-
 
-
 
80
#include "../3rdparty/MersenneTwister.h"
80
// or
81
// or
81
#include "randomwell.h"
-
 
-
 
82
//#include "randomwell.h"
82
83
83
MTRand *randomGenerator(); // static object lives in globalsettings
84
MTRand *randomGenerator(); // static object lives in globalsettings
84
/// nrandom returns a random number from [p1, p2] -> p2 is a possible result!
85
/// nrandom returns a random number from [p1, p2] -> p2 is a possible result!
85
inline double nrandom(const double& p1, const double& p2)
86
inline double nrandom(const double& p1, const double& p2)
86
{
87
{
Line 140... Line 141...
140
{
141
{
141
    return value & (1 << bit);
142
    return value & (1 << bit);
142
}
143
}
143
144
144
// define a global isnan() function
145
// define a global isnan() function
-
 
146
#ifndef isnan
145
#define isnan(x) ((x) != (x))
147
#define isnan(x) ((x) != (x))
-
 
148
#endif
146
149
147
#include "globalsettings.h"
150
#include "globalsettings.h"
148
151
149
#endif // GLOBAL_H
152
#endif // GLOBAL_H