]> git.treefish.org Git - phys/latlib.git/commitdiff
...
authorAlex Schmidt <alex@treefish.org>
Tue, 7 Aug 2012 14:30:14 +0000 (16:30 +0200)
committerAlex Schmidt <alex@treefish.org>
Tue, 7 Aug 2012 14:30:14 +0000 (16:30 +0200)
obs.hpp

diff --git a/obs.hpp b/obs.hpp
index dd9b23da061c96719142519df7566def487baacd..4d20bd6d901bff88f113d7a654a8fd87dca2ca4e 100644 (file)
--- a/obs.hpp
+++ b/obs.hpp
@@ -74,8 +74,7 @@ void obs<obstype>::mean(const string& compid, vector< vector<double> > *meas, co
   
   for(vector< vector<double> >::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 <typename obstype>
@@ -92,8 +91,7 @@ void obs<obstype>::mean(const string& compid, vector< vector<int> > *meas, const
   
   for(vector< vector<int> >::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 <typename obstype>