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
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.
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