length of genvar & speed



Each time the DE solver attempts a solution, it
must generate a polynomial with unknown coefficients.
I used gensyms for the coefficients; most members of
the genvar list are these gensyms. So yes, to solve
fifty DEs, my code generates 100s of symbols.  But
each CRE expression only has about ten variables.

In my testing code, I inserted a kill(all) after
each run.  That fixed the slowdown problem.  So
yes, I think the lengthy genvar list caused the
slowdown.  (My testing code runs in its own
read-eval-print loop.)  It seems  that kill(all)
sets genvar to nil.  But doing kill(all) after
each run has its own problems---I now get a
few “quotient is not exact” errors that I didn’t
have before.  Ick. (It’s possible that something
else changed...)

I’ll try your method of cleaning up CRE expressions;
if that does not work, I’ll try recycling gensyms
between runs.

Barton



-----Richard Fateman <fateman@cs.berkeley.edu> wrote: -----

To: Barton Willis <willisb@unk.edu>
From: Richard Fateman <fateman at cs>
Date: 07/24/2004 12:43AM
cc: maxima <maxima@www.ma.utexas.edu>
Subject: Re: [Maxima] length of genvar & speed

It is not clear why you would get such growth unless you
have hundreds of distinct symbols. Is that the case?  If you
look at your CRE form in lisp, does it have a huge list of
variables as well as a huge list of gensyms?