Re: Compiling
- To: mathgroup@smc.vnet.net
- Subject: [mg11343] Re: Compiling
- From: Matthias Berth <berth@rz.uni-greifswald.de>
- Date: Fri, 6 Mar 1998 00:41:02 -0500
- Organization: Uni Greifswald
- References: <6d0cod$2o6@smc.vnet.net>
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