base: Fix squares of stats
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Sat, 8 Feb 2020 11:38:02 +0000 (12:38 +0100)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Mon, 10 Feb 2020 22:35:24 +0000 (22:35 +0000)
commitf5e84a5fb989cc6dff0ec063578447a32dad6d5c
tree4f9cfc74fb0d290dff3df1b26d0d04db8f1b5b67
parentcc2732d5c3c1872f4fd3ec0a80de1662e2fae4bc
base: Fix squares of stats

If a sample V, which has a square(V) = V * V, was seen N times, then
its sum of squares is given by N * square(V).

Change-Id: Ie3fe0e4afe6e79ba4c8a5a56532f9346f79b4029
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25184
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/statistics.hh