Re: matrix-ref is slow

rif <[email protected]> Tue, 05 Nov 2002 18:40:35 -0500
Newsgroups gmane.lisp.matlisp.user
Message-ID <[email protected]>
Basically, I'm reading many many 28 dimensional vectors from a file,
doing a bunch of operations on each 28 dimensional to turn it into a
~4,500 dimensional vector, then keeping a running sum (eventually an
average when I'm done with the file and I know the count) of these
high-dimensional vectors.  My hope is to reuse only two
high-dimensional locations, one for the "current" vector and one for
the sum, to avoid excessive consing.  If I want to reuse a matlisp
matrix, this means many calls to mref.  If the store were exposed,
then I could implement it directly as calls to aref.

(If you're interested in the details, I'm basically nonlinearly
mapping the original vector to a higher dimensional space where the
dimensions are the products of up to three dimensions of the original
vector.  It's quite possible that the cost of this function dwarfs the cost of the consing, making my whole discussion premature optimization).

Cheers,

rif