Bug 151001 - vector entered from JavaScript does not have statistics calculated correctly
Summary: vector entered from JavaScript does not have statistics calculated correctly
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-18 21:58 UTC by Andrew Walker
Modified: 2007-10-19 01:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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