Peano
Loading...
Searching...
No Matches
Measurement.h
Go to the documentation of this file.
1// Copyright (C) 2009 Technische Universitaet Muenchen
2// This file is part of the Peano project. For conditions of distribution and
3// use, please see the copyright notice at www.peano-framework.org
4#pragma once
5
6
7#include <string>
8
9#include "tarch/logging/Log.h"
10
11
12namespace tarch::timing {
13 class Measurement;
14} // namespace tarch::timing
15
16
30private:
32
33 double _accuracy;
34
42
46 double _lastValue;
47
56
62 double _min;
63 double _max;
66
67 double getMeanValue() const;
68 double getMeanValueOfNextStep(double newValue) const;
69
70public:
71 Measurement(const double& accuracy = 0.0);
72 ~Measurement() = default;
73
78 double getValue() const;
79
84 double getMostRecentValue() const;
85
89 double getAccumulatedValue() const;
90
97 double getStandardDeviation() const;
98
123 bool isAccurateValue() const;
124
128 void setAccuracy(const double& value);
129
130 void increaseAccuracy(const double& factor);
131
137 void setValue(const double& value);
138 int getNumberOfMeasurements() const;
139 std::string toString() const;
140
141 double max() const;
142 double min() const;
143
144 void erase();
145
146 double getAccuracy() const;
147};
Log Device.
Definition Log.h:516
double getAccumulatedValue() const
Measurement(const double &accuracy=0.0)
double _accumulatedSquares
To compute the standard deviation, we rely on the formula.
Definition Measurement.h:55
double _numberOfMeasurements
Needed to compute average value and variance.
Definition Measurement.h:60
void increaseAccuracy(const double &factor)
void setAccuracy(const double &value)
double getMeanValueOfNextStep(double newValue) const
double _accumulatedValue
Accumulated value.
Definition Measurement.h:41
static tarch::logging::Log _log
Definition Measurement.h:31
double getStandardDeviation() const
We did face some seg faults (very rarely) where the parameter under the square root did become slight...
std::string toString() const
void setValue(const double &value)
Set the value.
double _lastValue
We store the last value.
Definition Measurement.h:46
bool isAccurateValue() const
Is value accurate.
double getMostRecentValue() const