> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IRockyStatisticsAccumulator Struct Reference

`#include <rocky_statistics_data.hpp>`

## Public Member Functions

| Type | Name |
| - | - |
| ROCKY\_FUNCTIONS void | [add\_value](#aa6f9107d44777f2914054a2567018438) (double value) |
| double | [get\_sum](#a465ef9a481493da8c59e760a3f37e3e6) () const |
| void | [reset](#acb15234baa81417b3382410594d7150b) () |
| void | [join](#a6a0a426d29d79255741700958cdc9511) (const [IRockyStatisticsAccumulator](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyStatisticsAccumulator.md) \&other) |

## Detailed Description

[`IRockyStatisticsAccumulator`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyStatisticsAccumulator) 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()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyStatisticsAccumulator::add_value(double value)
```

**This method adds a new value to the current sum.**

**Parameters**

| Name | Description |
| - | - |
| value | The value that must be added. |

### get\_sum()

```cpp theme={null}
double IRockyStatisticsAccumulator::get_sum() const
```

**Returns**

The value of the sum accumulated so far.

### join()

```cpp theme={null}
void IRockyStatisticsAccumulator::join(const IRockyStatisticsAccumulator & other)
```

**This method sums the values accumulated by two instances of**

[`IRockyStatisticsAccumulator`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyStatisticsAccumulator) associated to two separate sets of values. After calling this method, the value returned by `get_sum` will be the resulting sum.

**Parameters**

| Name | Description |
| - | - |
| other | The instance of [`IRockyStatisticsAccumulator`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyStatisticsAccumulator) that accumulated the second set of values. |

### reset()

```cpp theme={null}
void IRockyStatisticsAccumulator::reset()
```

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