MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

"Compile[]" and "InterpolatingFunction" objects

  • Subject: [mg2939] "Compile[]" and "InterpolatingFunction" objects
  • From: rich at news.acns.nwu.edu (Jonathan Rich)
  • Date: 13 Jan 1996 05:25:28 -0600
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: Northwestern University, Evanston, IL, US
  • Sender: mj at wri.com

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.



  • Prev by Date: Re: Part
  • Next by Date: Re: Part
  • Previous by thread: "Compile[]" and "InterpolatingFunction" objects
  • Next by thread: MMA on a PB 5300?