13 #ifndef _H_SST_CORE_ACCUMULATOR_STATISTIC_
14 #define _H_SST_CORE_ACCUMULATOR_STATISTIC_
18 #include <sst/core/sst_types.h>
19 #include <sst/core/warnmacros.h>
21 #include <sst/core/statapi/statbase.h>
22 #include <sst/core/statapi/statoutput.h>
25 namespace Statistics {
45 template <
typename NumberBase>
70 m_sum_sq += (value * value);
99 return (count > 0) ? (m_sum / (NumberBase) count) : 0;
109 return (count > 0) ? (m_sum_sq * count) - (m_sum * m_sum) : 0;
118 return (NumberBase) std::sqrt( (
double)
getVariance() );
144 void outputStatisticData(
StatisticOutput* statOutput,
bool UNUSED(EndOfSimFlag))
override
153 if (mode == StatisticBase::STAT_MODE_COUNT) {
156 if (mode == StatisticBase::STAT_MODE_PERIODIC) {
166 StatisticOutput::fieldHandle_t Field1, Field2, Field3;
void addData_impl(NumberBase value) override
Present a new value to the class to be included in the statistics.
Definition: stataccumulator.h:67
void registerOutputFields(StatisticOutput *statOutput) override
Called by the system to tell the Statistic to register its output fields.
Definition: stataccumulator.h:137
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
fieldHandle_t registerField(const char *fieldName)
Register a field to be output (templated function)
Definition: statoutput.h:85
void setStatisticTypeName(const char *typeName)
Set an optional Statistic Type Name.
Definition: statbase.h:202
Allows the online gathering of statistical information about a single quantity.
Definition: stataccumulator.h:46
uint64_t getCollectionCount() const
Return the current collection count.
Definition: statbase.h:145
void clearStatisticData() override
Inform the Statistic to clear its data.
Definition: stataccumulator.h:130
Forms the template defined base class for statistics gathering within SST.
Definition: statbase.h:294
NumberBase getVariance()
Get the variance of the values presented so far.
Definition: stataccumulator.h:106
NumberBase getSumSquared()
Provides the sum of each value squared presented to the class so far.
Definition: stataccumulator.h:87
Main component object for the simulation.
Definition: baseComponent.h:104
StatMode_t
Statistic collection mode.
Definition: statbase.h:65
Parameter store.
Definition: params.h:45
NumberBase getSum()
Provides the sum of the values presented so far.
Definition: stataccumulator.h:78
uint64_t getCount()
Get a count of the number of elements presented to the statistics collection so far.
Definition: stataccumulator.h:125
virtual void setCollectionCount(uint64_t newCount)
Set the current collection count to a defined value.
Definition: statbase.cc:45
NumberBase getArithmeticMean()
Get the arithmetic mean of the values presented so far.
Definition: stataccumulator.h:96
void outputField(fieldHandle_t fieldHandle, int32_t data)
Output field data.
Definition: statoutput.cc:166
NumberBase getStandardDeviation()
Get the standard deviation of the values presented so far.
Definition: stataccumulator.h:116