Version: 1.3.0_devel (using KDE 3.5.3, Kubuntu Package 4:3.5.3-0ubuntu0.1 dapper) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.15-25-686 The recent patch to fix 128483 has problems: Create to vectors of different lengths (eg, read two fields from a data source with different number of samples per frame). Create an equation with the shorter length vector as X and use the longer length vector in the equation (eg, [V2] + 1). Result: The output X vector will have the lenght of V2, but only the first [length_of_V1] samples will be set. Expected: the output X vector will be exactly the same as the input X vector, except for its name. Note that the current implementation attempts to copy the input vector to the output vector. I think that it would be better to instead create a new class aliasVector which simply returns the properties of the source vector, except for its name, without making a copy. Not sure what the cleanest C++ for this would be though.
This bug makes equations unusable for most dirfiles, where it is common for INDEX to have a different number of samples per frame than most fields. This needs to be fixed immediately, or the 'fix' to 128483 needs to be reverted until it is fixed. Additionally, a test case for this needs to be added.
SVN commit 553439 by netterfield: BUG: 129530 re-set the length of the output vector to the right thing.... M +4 -0 kstequation.cpp --- trunk/extragear/graphics/kst/src/libkstmath/kstequation.cpp #553438:553439 @@ -450,6 +450,10 @@ rawyv[ctx.i] = _pe->value(&ctx); } + if (!(*_xOutVector)->resize(iv->length())) { + // FIXME: handle error? + return false; + } return true; }
On Tuesday 20 June 2006 20:10, netterfield@astro.utoronto.ca wrote: > Note that the current implementation attempts to copy the input vector to > the output vector. I think that it would be better to instead create a new > class aliasVector which simply returns the properties of the source vector, > except for its name, without making a copy. Not sure what the cleanest C++ > for this would be though. I agree. It should be a proxy class.