Pari/GP Memoize "memoizes" a Pari/GP function so values returned by it on each call are cached and re-used. This is good for recursions, slow calculations, or initializations. See the comments in for details.

foo(x,y) = some_hairy_code(); ...;
foo = memoize(foo); is free software (free as in freedom), published under the terms of the GNU General Public License (v3 or higher). Download version 5 here, (21k, and sig)
memoize-5.tar.gz (25k, and sig)

The tar file has some self-tests but just is enough to run. The sig files are Gnu PG ascii armoured signatures generated from my key.

This page Copyright 2014, 2015, 2016, 2017 Kevin Ryde, except for the GPLv3 logo which is Copyright Free Software Foundation and used here in accordance with its terms.

(Back to the sitemap, or the Pari/GP section there)