From: Alex Schmidt Date: Tue, 7 Aug 2012 14:30:14 +0000 (+0200) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/67fd3c920d4a69ab05834f90603e2115e67e36c0 ... --- diff --git a/obs.hpp b/obs.hpp index dd9b23d..4d20bd6 100644 --- a/obs.hpp +++ b/obs.hpp @@ -74,8 +74,7 @@ void obs::mean(const string& compid, vector< vector > *meas, co for(vector< vector >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt) computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 ); - computations[compid].err /= nmeas-1; - computations[compid].err = sqrt( computations[compid].err ); + computations[compid].err = sqrt( computations[compid].err ) / nmeas; } template @@ -92,8 +91,7 @@ void obs::mean(const string& compid, vector< vector > *meas, const for(vector< vector >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt) computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 ); - computations[compid].err /= nmeas-1; - computations[compid].err = sqrt( computations[compid].err ); + computations[compid].err = sqrt( computations[compid].err ) / nmeas; } template