changeset 8301f882a916 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=8301f882a916
description:
        stats: adds a Formula operator for division

diffstat:

 src/base/statistics.cc |  10 ++++++++++
 src/base/statistics.hh |   8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r 69bb50791e25 -r 8301f882a916 src/base/statistics.cc
--- a/src/base/statistics.cc    Fri Sep 06 16:21:28 2013 -0500
+++ b/src/base/statistics.cc    Fri Sep 06 16:21:29 2013 -0500
@@ -387,6 +387,16 @@
     return *this;
 }
 
+const Formula &
+Formula::operator/=(Temp r)
+{
+    assert (root);
+    root = NodePtr(new BinaryNode<std::divides<Result> >(root, r));
+
+    assert(size());
+    return *this;
+}
+
 void
 Formula::result(VResult &vec) const
 {
diff -r 69bb50791e25 -r 8301f882a916 src/base/statistics.hh
--- a/src/base/statistics.hh    Fri Sep 06 16:21:28 2013 -0500
+++ b/src/base/statistics.hh    Fri Sep 06 16:21:29 2013 -0500
@@ -2856,6 +2856,14 @@
      * @return a reference to this formula.
      */
     const Formula &operator+=(Temp r);
+
+    /**
+     * Divide the existing tree by the given one.
+     * @param r The root of the expression tree.
+     * @return a reference to this formula.
+     */
+    const Formula &operator/=(Temp r);
+
     /**
      * Return the result of the Fomula in a vector.  If there were no Vector
      * components to the Formula, then the vector is size 1.  If there were,
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to