[Kst] branches/work/kst/portto4/kst/src/plugins/filters/cumulativesum

Nicolas Brisset nicolas.brisset at eurocopter.com
Sun Sep 30 16:38:48 UTC 2012


SVN commit 1318540 by brisset:

Fix index mistake, this was returning completely wrong values. Should be OK now.


 M  +2 -2      cumulativesum.cpp  


--- branches/work/kst/portto4/kst/src/plugins/filters/cumulativesum/cumulativesum.cpp #1318539:1318540
@@ -175,8 +175,8 @@
 
   outputVector->value()[0] = inputVector->value()[0];
 
-  for (int i = 0; i < inputVector->length()-1; i++) {
-    outputVector->value()[i+1] = inputVector->value()[i]*inputScalar->value() + outputVector->value()[i];
+  for (int i = 1; i < inputVector->length(); i++) {
+    outputVector->value()[i] = inputVector->value()[i]*inputScalar->value() + outputVector->value()[i-1];
   }
 
   return true;


More information about the Kst mailing list