Re: [q-lang-users] Vector module
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2007-10-04 10:25:10
|
Albert Graef wrote: > BTW, talking about sparse matrices, the Array data type already makes > for a very nice sparse vector and matrix data structure, [...] Did I really say that? Nonsense. :) Right now, 'array' always produces a full binary tree, so it's *not* suitable for sparse arrays. But a simple variation of the same idea should actually work for that purpose. If only the paths with a nonzero value are actually present in the tree, then AFAICS the space requirements for N nonzero elements would be O(N log N) which should be good enough for sparse arrays. It should actually be possible to do this without adding much overhead. I'll see whether I can modify Array along these lines, it should make it much more useful than it is now... Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |