IRockyStatisticsAccumulator Struct Reference
Last update: 08.07.2024
IRockyStatisticsAccumulator Struct Reference
#include <rocky_statistics_data.hpp>
Public Member Functions | |
ROCKY_FUNCTIONS void | add_value (double value) |
double | get_sum () const |
void | reset () |
void | join (const IRockyStatisticsAccumulator &other) |
Detailed Description
IRockyStatisticsAccumulator
is an auxiliary struct that can be used to sum a set of values generated during a period of time in a simulation. That sum may be an approximation of the value of an integral, needed for calculating integral-based statistics. Such integral can represent a physical magnitude, for instance, an impulse or a work. Please refer to the DEM Technical Manual for a complete description of integral-based statistics.
Member Function Documentation
◆ add_value()
ROCKY_FUNCTIONS void IRockyStatisticsAccumulator::add_value | ( | double | value | ) |
- This method adds a new value to the current sum.
- Parameters
-
value The value that must be added.
◆ get_sum()
double IRockyStatisticsAccumulator::get_sum | ( | ) | const |
- Returns
- The value of the sum accumulated so far.
◆ join()
void IRockyStatisticsAccumulator::join | ( | const IRockyStatisticsAccumulator & | other | ) |
- This method sums the values accumulated by two instances of
IRockyStatisticsAccumulator
associated to two separate sets of values. After calling this method, the value returned byget_sum
will be the resulting sum.
- Parameters
-
other The instance of IRockyStatisticsAccumulator
that accumulated the second set of values.
◆ reset()
void IRockyStatisticsAccumulator::reset | ( | ) |
- This method resets to zero the sum in order to start a new accumulation round.