diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-10 16:19:40 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-10 16:19:40 -0600 |
commit | cfe912a5127b51273d7e3e78c15095ac832f20bd (patch) | |
tree | 1585ad1befbbcb9bd50e1dc02c96cf9b1cccf209 /src/base/statistics.hh | |
parent | 0387281e2a83fe34ddb23cc48a9f86fd60729d25 (diff) | |
download | gem5-cfe912a5127b51273d7e3e78c15095ac832f20bd.tar.xz |
stats: add function for adding two histograms
This patch adds a function to the HistStor class for adding two histograms.
This functionality is required for Ruby. It also adds support for printing
histograms in a single line.
Diffstat (limited to 'src/base/statistics.hh')
-rw-r--r-- | src/base/statistics.hh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/base/statistics.hh b/src/base/statistics.hh index cc1b59e7f..048c1be86 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -228,12 +228,12 @@ class DataWrap : public InfoAccess /** * Copy constructor, copies are not allowed. */ - DataWrap(const DataWrap &stat); + DataWrap(const DataWrap &stat) {} /** * Can't copy stats. */ - void operator=(const DataWrap &); + void operator=(const DataWrap &) {} public: DataWrap() @@ -1502,6 +1502,7 @@ class HistStor void grow_up(); void grow_out(); void grow_convert(); + void add(HistStor *); /** * Add a value to the distribution for the given number of times. @@ -1840,6 +1841,12 @@ class DistBase : public DataWrap<Derived, DistInfoProxy> { data()->reset(this->info()); } + + /** + * Add the argument distribution to the this distibution. + */ + void add(DistBase &d) { data()->add(d.data()); } + }; template <class Stat> |