[racket] Mutable state vs RAM on fire

From: joshua at anwu.org (joshua at anwu.org)
Date: Thu May 3 13:18:46 EDT 2012

Party out of a desire to be explicit, but mosty because no polynomial
to be multiplied will ever need the zero position.  I found working
with hashtables less awkward than vectors had been, for this reason.

My latest hash-based version also calculates 300 multiplications in
around 4 seconds.  Not as fast as the one that used mutable vectors,
but acceptable.


tk


On Wed, May 02, 2012 at 11:50:25PM -0400, Deren Dohoda wrote:
> 
> I was curious as to why you stored the exponents at all. If your
> polynomials aren't sparse (mostly zero coefficients) then just store
> the list of coefficients in ascending or descending order and have the
> exponents implied. The only time I needed to keep track of exponents
> was shifting the origin and composing polynomials.
> 
> Deren
> 

Posted on the users mailing list.