Deleted Added
sdiff udiff text old ( 6154:6bb54dcb940e ) new ( 7002:48a19d52d939 )
full compact
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 23 unchanged lines hidden (view full) ---

32 *
33 * Description: The histogram class implements a simple histogram
34 *
35 */
36
37#ifndef HISTOGRAM_H
38#define HISTOGRAM_H
39
40#include "mem/ruby/common/Global.hh"
41#include "mem/gems_common/Vector.hh"
42
43class Histogram {
44public:
45 // Constructors
46 Histogram(int binsize = 1, int bins = 50);
47

--- 8 unchanged lines hidden (view full) ---

56 void clear(int bins);
57 void clear(int binsize, int bins);
58 int64 size() const { return m_count; }
59 int getBins() const { return m_bins; }
60 int getBinSize() const { return m_binsize; }
61 int64 getTotal() const { return m_sumSamples; }
62 int64 getData(int index) const { return m_data[index]; }
63
64 void printWithMultiplier(ostream& out, double multiplier) const;
65 void printPercent(ostream& out) const;
66 void print(ostream& out) const;
67private:
68 // Private Methods
69
70 // Private copy constructor and assignment operator
71 // Histogram(const Histogram& obj);
72 // Histogram& operator=(const Histogram& obj);
73
74 // Data Members (m_ prefix)

--- 8 unchanged lines hidden (view full) ---

83 int64 m_sumSquaredSamples; // the sum of the square of all samples
84
85 double getStandardDeviation() const;
86};
87
88bool node_less_then_eq(const Histogram* n1, const Histogram* n2);
89
90// Output operator declaration
91ostream& operator<<(ostream& out, const Histogram& obj);
92
93// ******************* Definitions *******************
94
95// Output operator definition
96extern inline
97ostream& operator<<(ostream& out, const Histogram& obj)
98{
99 obj.print(out);
100 out << flush;
101 return out;
102}
103
104#endif //HISTOGRAM_H