[Maxima] cacheing compiled integrand in quadpack functions
Stavros Macrakis
macrakis at alum.mit.edu
Wed Jan 11 14:46:48 CST 2006
------=_Part_7684_2651560.1137012408735
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
>
> the quadpack functions (quad_qags etc) call COMPILE on the
> integrand. i'm working on a problem in which i'd like to evaluate
> the integrand repeatedly for different limits of integration,
> so it seems like the integrand only needs to be compiled once.
> does it seem reasonable and practical to put the compiled
> integrand into a hash table with the integrand as the key?
Sounds like a very sensible idea for your own uses.
It might be more problematic to have it as part of the standard library,
because the user may have redefined macros or changed translator or compile=
r
flags between one call and the next. Perhaps a reasonable compromise
between getting the semantics exactly right and not worrying about unusual
or rare cases would be to use the translated-to-Lisp (Translate) version of
the integrand as the key instead of the source form. Translation-to-Lisp
should be several orders of magnitude faster than full compilation, which
starts an external process, etc.
------=_Part_7684_2651560.1137012408735
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(=
204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">the quadpack=
functions (quad_qags etc) call COMPILE on the<br>integrand. i'm working on=
a problem in which i'd like to evaluate
<br>the integrand repeatedly for different limits of integration,<br>so it =
seems like the integrand only needs to be compiled once.<br>does it seem re=
asonable and practical to put the compiled<br>integrand into a hash table w=
ith the integrand as the key?
</blockquote><div><br></div></div>Sounds like a very sensible idea for your=
own uses.<br><br>It might be more problematic to have it as part of the st=
andard library, because the user may have redefined macros or changed trans=
lator or compiler flags between one call and the next. Perhaps a reas=
onable compromise between getting the semantics exactly right and not worry=
ing about unusual or rare cases would be to use the translated-to-Lisp (Tra=
nslate) version of the integrand as the key instead of the source form.&nbs=
p; Translation-to-Lisp should be several orders of magnitude faster than fu=
ll compilation, which starts an external process, etc.
<br>
------=_Part_7684_2651560.1137012408735--
More information about the Maxima
mailing list