Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Compile problem

  • To: mathgroup at
  • Subject: [mg52369] Compile problem
  • From: Joerg Schaber <schaber at>
  • Date: Thu, 25 Nov 2004 05:49:39 -0500 (EST)
  • Sender: owner-wri-mathgroup at


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},
	Index = Table[0, {lambda}];
           For[i = 1, i <= lambda, i++,
             Index[[i]] = f[[i]];

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?



  • Prev by Date: Re: Mathematica&SuSe 9.2: Inputformulars disabled
  • Next by Date: Re: Principal Value integral
  • Previous by thread: Re: Pattern matching partial derivatives
  • Next by thread: Re: Compile problem