Re: matrix-ref is slow

Raymond Toy <[email protected]> 06 Nov 2002 09:12:20 -0500
Newsgroups gmane.lisp.matlisp.user
Message-ID <[email protected]>
>>>>> "rif" == rif  <[email protected]> writes:

    rif> Basically, I'm reading many many 28 dimensional vectors from a file,
    rif> doing a bunch of operations on each 28 dimensional to turn it into a
    rif> ~4,500 dimensional vector, then keeping a running sum (eventually an
    rif> average when I'm done with the file and I know the count) of these
    rif> high-dimensional vectors.  My hope is to reuse only two
    rif> high-dimensional locations, one for the "current" vector and one for
    rif> the sum, to avoid excessive consing.  If I want to reuse a matlisp
    rif> matrix, this means many calls to mref.  If the store were exposed,
    rif> then I could implement it directly as calls to aref.

In this case, I would keep the high-dimensional vector as a Lisp
vector.  When I'm done, I'd convert it to a Matlisp vector.

But feel free to use store.  It's very, very, unlikely to change.

Ray