Bug 151001

Summary: vector entered from JavaScript does not have statistics calculated correctly
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Andrew Walker 2007-10-18 21:58:04 UTC
Version:           1.6.0 (using KDE KDE 3.5.3)
OS:                Linux

The following JavaScript code:

v = new Vector();
v.resize(3);
v[0] = 0;
v]1] = 2;
v[2] = 3;
v.mean

gives:
NaN
Comment 1 Andrew Walker 2007-10-19 00:51:56 UTC
The problem is that the scalars giving the mean, min, max, etc are not updated when a vector index is updated. One possibility would be to update every time we do something like v[0]=2, which could be expensive, or we could add an explicit update  method. Perhaps we could return an error if a user tries to retrieve metadata about a vector when the vector is dirty.
Comment 2 Andrew Walker 2007-10-19 01:19:19 UTC
SVN commit 726797 by arwalker:

BUG:151001 ensure that the min, max, and mean values associated with a vector are always updated before being returned. Add an update method to force update of these and other scalar values associated with a vector

 M  +39 -3     bind_matrix.cpp  
 M  +5 -0      bind_matrix.h  
 M  +39 -4     bind_vector.cpp  
 M  +5 -0      bind_vector.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=726797