Go to the source code of this file.
|
int | max (int a, int b) |
| This function will calculate the maximum of 2 numbers (integers) More...
|
|
double | max (double a, double b) |
| This function will calculate the maximum of 2 numbers (doubles) More...
|
|
int | min (int a, int b) |
| This function will calculate the minimum of 2 numbers (integers) More...
|
|
double | min (double a, double b) |
| This function will calculate the minimum of 2 numbers (doubles) More...
|
|
int | isZero (double a) |
| This function will check to see if a number is very close to zero. More...
|
|
int | isEqual (double a, double b) |
| This function will check to see if two numbers are equal. More...
|
|
int | isSmall (double a) |
| This function will check to see if a number is rather small (or zero) More...
|
|
double | logFactorial (double n) |
| This function will calculate the value of the logarithm of n factorial. More...
|
|
double | expRep (double n) |
| This function will calculate the value of the exponential of n. More...
|
|
double | randomNumber () |
| This function will generate a random number in the range 0.0 to 1.0. More...
|
|
double | calcMortality (double pred, double pop, double t) |
| This function will calculate the calculate the effective annual mortality caused by a given predation on a specified population during a timestep. More...
|
|
|
const double | pivalue = atan(1.0) * 4.0 |
| This is the value of pi used in the simulation. More...
|
|
◆ calcMortality()
double calcMortality |
( |
double |
pred, |
|
|
double |
pop, |
|
|
double |
t |
|
) |
| |
|
inline |
This function will calculate the calculate the effective annual mortality caused by a given predation on a specified population during a timestep.
- Parameters
-
pred | is the number that is removed from the population by the predation |
pop | is the population size (before predation) |
t | is the inverse of proportion of the year covered by the current timestep |
- Returns
- calculated mortality
◆ expRep()
double expRep |
( |
double |
n | ) |
|
|
inline |
This function will calculate the value of the exponential of n.
- Parameters
-
n | is the number that the exponential will be calculated for |
- Returns
- the value of exp (n)
- Note
- This function replaces 'exp' to return a value in the range 0.0 to 1.0
◆ isEqual()
int isEqual |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
inline |
This function will check to see if two numbers are equal.
- Parameters
-
a | is the first number that is being checked |
b | is the second number that is being checked |
- Returns
- 1 if the two numbers are equal, 0 otherwise
- Note
- This function replaces 'a == b' to take account of numerical inaccuracies when calculating the exact value of a double
◆ isSmall()
This function will check to see if a number is rather small (or zero)
- Parameters
-
a | is the number that is being checked |
- Returns
- 1 if the number is rather small, 0 otherwise
◆ isZero()
This function will check to see if a number is very close to zero.
- Parameters
-
a | is the number that is being checked |
- Returns
- 1 if the number is very close to zero, 0 otherwise
- Note
- This function replaces 'a == 0' to take account of numerical inaccuracies when calculating the exact value of a double
◆ logFactorial()
double logFactorial |
( |
double |
n | ) |
|
|
inline |
This function will calculate the value of the logarithm of n factorial.
- Parameters
-
n | is the number that the logfactorial will be calculated for |
- Returns
- the value of log(n!)
- Note
- This function is not an ANSI function and so will not compile correctly if gadget is compiled with the
-ansi
flag, unless we include #define
__GNU_SOURCE
in this file
◆ max() [1/2]
double max |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
inline |
This function will calculate the maximum of 2 numbers (doubles)
- Parameters
-
a | is the first number |
b | is the second number |
- Returns
- a if a is greater than b, b otherwise
◆ max() [2/2]
This function will calculate the maximum of 2 numbers (integers)
- Parameters
-
a | is the first number |
b | is the second number |
- Returns
- a if a is greater than b, b otherwise
◆ min() [1/2]
double min |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
inline |
This function will calculate the minimum of 2 numbers (doubles)
- Parameters
-
a | is the first number |
b | is the second number |
- Returns
- a if a is less than b, b otherwise
◆ min() [2/2]
This function will calculate the minimum of 2 numbers (integers)
- Parameters
-
a | is the first number |
b | is the second number |
- Returns
- a if a is less than b, b otherwise
◆ randomNumber()
This function will generate a random number in the range 0.0 to 1.0.
- Returns
- random number
- Note
- This function generates uniformly-distributed doubles in the range 0.0 to 1.0
◆ pivalue
const double pivalue = atan(1.0) * 4.0 |
This is the value of pi used in the simulation.