[plt-scheme] build-vector avoids sharing problem

From: Bill Richter (richter at math.northwestern.edu)
Date: Thu Feb 6 02:04:36 EST 2003

   From: Matt Jadud <mcj4 at ukc.ac.uk>

   http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/scheme/
   code/math/matrix/

Thanks, Matt.  Your function (matrix:create row-size col-size fn)
creates the same Richard's matrix, but it uses `do' twice instead of
`build-vector' twice.  I sorta realized you could do that.

What's really interesting about your matrix code is that it does all
the matrix ops, Gauss Jordan elimination etc, and I'll be getting to
soon, so I should study your code for good optimizations.  I'm gonna
have some millions by millions matrices.

Here's a dumb optimization question: My code is for 2 purposes:

1) to write some nice code I can put in a Math paper which calculate
   the homology of the Lambda algebra for low dimensions (t <= 30)

2) to compute far, which means fast, say t <= 100.

For (1), I'd want to write it in Advanced Student, which has nice data
structures etc, because speed is no issue.

For (2), I assume I want to use a Scheme->C translator like Gambit.
But will Gambit etc. accept Advanced Student constructions?  Can I
front-end a macro that say turns (local ((define ... ))) into a
(letrec ... ) construction?  Will Gambit accept the macro?  

This problem must come up a lot, how do you deal with it?



Posted on the users mailing list.