Re: Compile problem
- To: mathgroup at smc.vnet.net
- Subject: [mg52400] Re: Compile problem
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Fri, 26 Nov 2004 01:04:28 -0500 (EST)
- Organization: Uni Leipzig
- References: <co4dmr$l69$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, the problem is that you have written Compile[__,Module[___];] and so the final Null of compound expression will returned. Regards Jens "Joerg Schaber" <schaber at molgen.mpg.de> schrieb im Newsbeitrag news:co4dmr$l69$1 at smc.vnet.net... > Hi, > > here I provide a simple test code (just copies a vector) which denies to > compile but gives the error message "The type of return values in ... > are different". > I am using Mathematica 5.0. > > SRSort = Compile[{{f, _Real, 1}}, Module[{lambda,i}, > lambda=Length[f]; > Index = Table[0, {lambda}]; > For[i = 1, i <= lambda, i++, > Index[[i]] = f[[i]]; > ]; > Return[Index]; > ]; > ]; > > When I just put "Index" at the end of the loop, the function compiles > but does not deliver any output. > Any idea what's the problem here? > > Thanks, > > joerg >