cron
travis-ci
171 of 171 new or added lines in 3 files covered. (100.0%)
43925 of 147832 relevant lines covered (29.71%)
297547.37 hits per line
1 |
#include "dispersion.h" |
|
2 |
|
|
3 |
#include "rng.h" |
|
4 |
|
|
5 |
double dispersion_sources::roll() const |
2,382,783✔ |
6 |
{ |
|
7 |
double this_roll = 0.0; |
|
8 |
for( const double &source : linear_sources ) { |
11,875,983✔ |
9 |
this_roll += rng_float( 0.0, source ); |
9,493,200✔ |
10 |
} |
|
11 |
for( const double &source : normal_sources ) { |
4,765,564✔ |
12 |
this_roll += rng_normal( source ); |
2,382,781✔ |
13 |
} |
|
14 |
for( const double &source : multipliers ) { |
2,382,783✔ |
15 |
this_roll *= source; |
× |
16 |
} |
|
17 |
return this_roll;
|
2,382,783✔ |
18 |
} |
|
19 |
|
|
20 |
double dispersion_sources::max() const |
63✔ |
21 |
{ |
|
22 |
double sum = 0.0; |
|
23 |
for( const double &source : linear_sources ) { |
252✔ |
24 |
sum += source; |
189✔ |
25 |
} |
|
26 |
for( const double &source : normal_sources ) { |
126✔ |
27 |
sum += source; |
63✔ |
28 |
} |
|
29 |
for( const double &source : multipliers ) { |
63✔ |
30 |
sum *= source; |
× |
31 |
} |
|
32 |
return sum;
|
63✔ |
33 |
} |
|
34 |
|
|
35 |
double dispersion_sources::avg() const |
× |
36 |
{ |
|
37 |
return max() / 2.0; |
× |
38 |
} |
|
39 |
|