![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Base class to track and compute statistics about the distribution of a sequence of double. We provide a few sub-classes below that differ in the way the values are added to the sequence and in the way the stats are printed.
#include <stats.h>
Public Member Functions | |
| DistributionStat (absl::string_view name) | |
| DistributionStat () | |
| DistributionStat (absl::string_view name, StatsGroup *group) | |
| ~DistributionStat () override | |
| void | Reset () override |
| Reset this statistic to the same state as if it was newly created. | |
| bool | WorthPrinting () const override |
| Is this stat worth printing? Usually false if nothing was measured. | |
| std::string | ValueAsString () const override=0 |
| Implemented by the subclasses. | |
| double | Sum () const override |
| Trivial statistics on all the values added so far. | |
| double | Max () const |
| double | Min () const |
| int64_t | Num () const |
| double | Average () const |
| Get the average of the distribution or 0.0 if empty. | |
| double | StdDeviation () const |
| Public Member Functions inherited from operations_research::Stat | |
| Stat (absl::string_view name) | |
| Stat (absl::string_view name, StatsGroup *group) | |
| Also add this stat to the given group. | |
| virtual | ~Stat () |
| std::string | Name () const |
| Only used for display purposes. | |
| std::string | StatString () const |
| virtual int | Priority () const |
Protected Member Functions | |
| void | AddToDistribution (double value) |
| Adds a value to this sequence and updates the stats. | |
Protected Attributes | |
| double | sum_ |
| double | average_ |
| double | sum_squares_from_average_ |
| double | min_ |
| double | max_ |
| int64_t | num_ |
|
explicit |
|
inline |
| operations_research::DistributionStat::DistributionStat | ( | absl::string_view | name, |
| StatsGroup * | group ) |
|
inlineoverride |
|
protected |
| double operations_research::DistributionStat::Average | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Reset this statistic to the same state as if it was newly created.
Implements operations_research::Stat.
| double operations_research::DistributionStat::StdDeviation | ( | ) | const |
Get the standard deviation of the distribution or 0.0 if empty. We use the on-line algorithm of Welford described at http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
|
inlineoverridevirtual |
Trivial statistics on all the values added so far.
Reimplemented from operations_research::Stat.
|
overridepure virtual |
Implemented by the subclasses.
Implements operations_research::Stat.
Implemented in operations_research::DoubleDistribution, operations_research::IntegerDistribution, operations_research::RatioDistribution, operations_research::TimeDistribution, and TimeDistribution.
|
inlineoverridevirtual |
Is this stat worth printing? Usually false if nothing was measured.
Implements operations_research::Stat.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |