Mean

class cubie.outputhandling.summarymetrics.mean.Mean(precision)[source]

Bases: SummaryMetric

Summary metric that calculates the arithmetic mean of a variable.

Notes

The metric uses a single buffer slot per variable to accumulate the sum of values and divides by the number of integration steps when the results are saved.

__init__(precision) None[source]

Initialise the Mean summary metric with fixed buffer sizes.

build() MetricFuncCache[source]

Generate CUDA device functions for mean value calculation.

Returns:

Cache containing the device update and save callbacks.

Return type:

MetricFuncCache

Notes

The update callback accumulates the running sum while the save callback divides by summarise_every and resets the buffer.