    

 ## On this page

  

 

 # IRockyStatisticsAccumulator Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__statistics__data_8hpp_source.xhtml">rocky_statistics_data.hpp</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

ROCKY\_FUNCTIONS void [add\_value](#aa6f9107d44777f2914054a2567018438) (double value) double [get\_sum](#a465ef9a481493da8c59e760a3f37e3e6) () const void [reset](#acb15234baa81417b3382410594d7150b) () void [join](#a6a0a426d29d79255741700958cdc9511) (const [IRockyStatisticsAccumulator](structIRockyStatisticsAccumulator.xhtml) &amp;other) <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockyStatisticsAccumulator.xhtml">IRockyStatisticsAccumulator</a>` 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

<a id="aa6f9107d44777f2914054a2567018438" name="aa6f9107d44777f2914054a2567018438"></a>## [◆ ](#aa6f9107d44777f2914054a2567018438)add\_value()

 ROCKY\_FUNCTIONS void IRockyStatisticsAccumulator::add\_value  ( double *value*) 

This method adds a new value to the current sum.Parameters valueThe value that must be added. 



<a id="a465ef9a481493da8c59e760a3f37e3e6" name="a465ef9a481493da8c59e760a3f37e3e6"></a>## [◆ ](#a465ef9a481493da8c59e760a3f37e3e6)get\_sum()

 double IRockyStatisticsAccumulator::get\_sum  ( )  const

ReturnsThe value of the sum accumulated so far. 



<a id="a6a0a426d29d79255741700958cdc9511" name="a6a0a426d29d79255741700958cdc9511"></a>## [◆ ](#a6a0a426d29d79255741700958cdc9511)join()

 void IRockyStatisticsAccumulator::join  ( const [IRockyStatisticsAccumulator](structIRockyStatisticsAccumulator.xhtml) &amp; *other*) 

This method sums the values accumulated by two instances of`<a class="el" href="structIRockyStatisticsAccumulator.xhtml">IRockyStatisticsAccumulator</a>` associated to two separate sets of values. After calling this method, the value returned by `get_sum` will be the resulting sum.Parameters otherThe instance of `<a class="el" href="structIRockyStatisticsAccumulator.xhtml">IRockyStatisticsAccumulator</a>` that accumulated the second set of values. 



<a id="acb15234baa81417b3382410594d7150b" name="acb15234baa81417b3382410594d7150b"></a>## [◆ ](#acb15234baa81417b3382410594d7150b)reset()

 void IRockyStatisticsAccumulator::reset  ( ) 

This method resets to zero the sum in order to start a new accumulation round.