Kevin Ryde on Fri, 07 Apr 2017 10:10:33 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: writing a "module" in pari-gp
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: writing a "module" in pari-gp
- From: Kevin Ryde <user42_kevin@yahoo.com.au>
- Date: Fri, 07 Apr 2017 18:08:26 +1000
- Cc: Kevin Buzzard <kevin.m.buzzard@gmail.com>
- Delivery-date: Fri, 07 Apr 2017 10:10:33 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048; t=1491552623; bh=/TMCuBHnT7Qg1I+1zd8dDnz5hSOAg0awQee2T63wyao=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject; b=InH+Dhrlz36LqrVw0yjWBv8o1kYWJKIqTCFidZBJC5U/MTBoHck326eWIEakwcNe+FqLnsFnYWezdezUM7iNYJ1XHfNYC2LET0dAlUKZaXk7oSclTNEJ3osNv4rdHeM2mzCweAoVrpATrhtNQh2H1Z2QqljWC3t36j48z+RzsFlJEqIPedMc452ArN2/F+lRWrDTrFomDnZ29ufvYYoMQkPYHErrcJdrDEUGJ2JCNDlYuWjVI/admeOd7WoHhbtY35fL4GEkLgy1X0Se5NkUh7j/3GGJxSZn+HrQT0h+gxupXtv4XJrw1LPBauDe5d6bsX/0WVgSM4ozV3SLkowxMQ==
- In-reply-to: <CAH52Xb2Mz7e-jiE8DeXRBPOWF-rPbbTzsW+P5ROK=Uu3Uxccdg@mail.gmail.com> (Kevin Buzzard's message of "Wed, 5 Apr 2017 14:30:04 +0100")
- Organization: Bah Humbug
- References: <CAH52Xb2Mz7e-jiE8DeXRBPOWF-rPbbTzsW+P5ROK=Uu3Uxccdg@mail.gmail.com>
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Kevin Buzzard <kevin.m.buzzard@gmail.com> writes:
>
> ... so I would
> ideally like to remember the values of computations if they have been
> done already. This is an independent question but is this sort of
> thing possible or easy nowadays?
I made a generic memoize for user functions. I mainly use it for
naively written recursions.
http://user42.tuxfamily.org/pari-memoize/index.html
Caching is only within the gp session. It does the same sort of Map()
which Bill said, but it's handy to chuck foo=memoize(foo) on existing
funcs when you find them going a bit slow.