From 6e48ef129da93ac185e50549a90d5481d3ac7a09 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Tue, 9 Jul 2013 13:34:12 +0200 Subject: [PATCH] Give variables a more meaningful name --- include/hep/mc/mc_helper.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hep/mc/mc_helper.hpp b/include/hep/mc/mc_helper.hpp index 06fa70b..1183f4b 100644 --- a/include/hep/mc/mc_helper.hpp +++ b/include/hep/mc/mc_helper.hpp @@ -44,24 +44,24 @@ template mc_result cumulative_result(MCResultIterator begin, MCResultIterator end) { std::size_t calls = 0; - T value = T(); - T error = T(); + T estimate = T(); + T variance = T(); for (MCResultIterator i = begin; i != end; ++i) { T const tmp = T(1.0) / (i->error * i->error); calls += i->calls; - error += tmp; - value += tmp * i->value; + variance += tmp; + estimate += tmp * i->value; } - error = T(1.0) / error; - value *= error; + variance = T(1.0) / variance; + estimate *= variance; return mc_result( calls, - T(calls) * value, - T(calls) * (value * value + T(calls) * error) + T(calls) * estimate, + T(calls) * (estimate * estimate + T(calls) * variance) ); }