cron
travis-ci
54372 of 164333 relevant lines covered (33.09%)
612254.88 hits per line
1 |
#include "dispersion.h" |
|
2 |
|
|
3 |
#include "rng.h" |
|
4 |
|
|
5 |
double dispersion_sources::roll() const |
5,101,079✔ |
6 |
{ |
|
7 |
double this_roll = 0.0; |
|
8 |
for( const double &source : linear_sources ) { |
25,461,483✔ |
9 |
this_roll += rng_float( 0.0, source ); |
20,360,404✔ |
10 |
} |
|
11 |
for( const double &source : normal_sources ) { |
10,202,156✔ |
12 |
this_roll += rng_normal( source ); |
5,101,077✔ |
13 |
} |
|
14 |
for( const double &source : multipliers ) { |
5,101,079✔ |
15 |
this_roll *= source; |
× |
16 |
} |
|
17 |
return this_roll;
|
5,101,079✔ |
18 |
} |
|
19 |
|
|
20 |
double dispersion_sources::max() const |
38✔ |
21 |
{ |
|
22 |
double sum = 0.0; |
|
23 |
for( const double &source : linear_sources ) { |
152✔ |
24 |
sum += source; |
114✔ |
25 |
} |
|
26 |
for( const double &source : normal_sources ) { |
76✔ |
27 |
sum += source; |
38✔ |
28 |
} |
|
29 |
for( const double &source : multipliers ) { |
38✔ |
30 |
sum *= source; |
× |
31 |
} |
|
32 |
return sum;
|
38✔ |
33 |
} |
|
34 |
|
|
35 |
double dispersion_sources::avg() const |
× |
36 |
{ |
|
37 |
return max() / 2.0; |
× |
38 |
} |
9✔ |
39 |
|