"Compile[]" and "InterpolatingFunction" objects
- To: mathgroup at smc.vnet.net
- Subject: [mg2939] "Compile[]" and "InterpolatingFunction" objects
- From: Jonathan Rich <rich at news.acns.nwu.edu>
- Date: Sat, 13 Jan 1996 03:20:39 -0500
- Organization: Northwestern University, Evanston, IL, US
I am trying to produce efficient compiled code which evaluates an expression
that includes "InterpolatingFunction" objects. So I have two questions:
1) Are "InterpolatingFunction" objects Compiled by default? The Book doesn't
say although in Appendix A.8 under "InterpolatingFunction" it says
`See also: CompiledFunction'.
2) How do I compile an InterpolatingFunction w/o having the compiled
pseudocode
use an external evaluation (pseudocode instruction # 24) for the result of the
InterpolatingFunction? Here is a simple example:
list=Table[{i,i},{i,4}];
interpFunc=Interpolation[list];
f1=Compile[{x},Evaluate[interpFunc[x]]];
f1//InputForm
In the output you will see that the compiled code uses an external evaluation,
which defeats the whole purpose of using "Compile[]" (which is to speed up the
computation--it may be that "Interpolation[]" produces compiled code, but I
can't find this documented anywhere).
Thanks for your help on this.
--
Jonathan Rich
Geoscience Dept., Northwestern Univ.
==== [MESSAGE SEPARATOR] ====