[Kst] [Bug 121566] rms scalar is wrong

George Staikos staikos at kde.org
Wed Feb 8 05:33:40 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121566         




------- Additional Comments From staikos kde org  2006-02-08 05:33 -------
SVN commit 506997 by staikos:

correct RMS
Looks like a refactoring gone wrong...  Ok for 1.2.0 and trunk?
CCBUG: 121566


 M  +2 -2      kstvector.cpp  


--- branches/kst/hfi_calib/kst/kst/kstvector.cpp #506996:506997
 @ -195,9 +195,9  @
 
     if (_nsum >= 2) {
       double sum = _scalars["sum"]->value();
-      double sumsq;
+      double sumsq = _scalars["sumsquared"]->value();
       _scalars["mean"]->setValue(_mean = sum/double(_nsum));
-      _scalars["sigma"]->setValue(sumsq = sqrt((_scalars["sumsquared"]->value() - sum * sum / double(_nsum)) / double(_nsum-1)));
+      _scalars["sigma"]->setValue(sqrt((sumsq - sum * sum / double(_nsum)) / double(_nsum-1)));
       _scalars["rms"]->setValue(sqrt(sumsq/double(_nsum)));
     } else {
       _scalars["sigma"]->setValue(_max - _min);


More information about the Kst mailing list