On Mon, Apr 19, 2010 at 5:33 PM, Jake Mannix <jake.man...@gmail.com> wrote: > result.times(-1.0) > with > result.assign(Functions.negate)
Cool, good one. > The efficiency points are twofold: number of nonzero elements, and > the impl: you don't want to iterate over a vector of any type while > continually calling setQuick() on a SequentialAccessSparseVector - > that is horribly inefficient, as it causes a binary search each time, > followed by a possible copy/shift of most of the index and value > arrays. ah yeah sure. So really it'd be easier to specialize the one where random access is slow. I can manage that.