MathGroup Archive 1998

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

Search the Archive

Re: Compiling



JOHN C ERB wrote:

> When I try to compile the routine:
> 
> fc=Compile[{h,_Real},Map[Interpolation[alaway][#[[1]],#[[2]]]&,h]]
> 
> I get:
> 
> Compile::"cplist":
>     h should be a tensor of type Integer, Real, or Complex;  evaluation
> will use the uncompiled function."

as you say, h is a list of (x,y)-pairs. Then you must specify it as a
rank 2 array, i.e.:

Compile[{h,_Real,2}, ...]

so the compiler knows what to expect as an argument. You get the error
message because you declared h to be a Real number and Mathematica
doesn't know how to Map[] a function to this. 

Check out David Wagner's "Power Programming with Mathematica - The
Kernel", there is a very good chapter on compilation and many useful
hints for improving performance. 


regards

Matthias

-----------------------------
Matthias Berth, Ph. D. student
Institute for Mathematics and Computer Science University of Greifswald

berth@rz.uni-greifswald.de



  • Prev by Date: RE: Re: algebraic solutions
  • Next by Date: Re: anyone help with this... (lonely numbers)
  • Prev by thread: Re: Compiling
  • Next by thread: Default Font