MathGroup Archive 2011

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

Search the Archive

Re: Compile and Total


Fred, DrMajorBob, Patrick---thank you very much for your replies. Continuing
Fred's code:

<<CompiledFunctionTools`;

(* This does not compile *)
g = Total;
gC = Compile[{{x, _Real, 1}}, g[x], 
   CompilationOptions -> {"InlineExternalDefinitions" -> True}];
CompilePrint[gC]

(* This does *)
g = Total[#] &;
gC = Compile[{{x, _Real, 1}}, g[x], 
   CompilationOptions -> {"InlineExternalDefinitions" -> True}];
CompilePrint[gC]

I don't understand why, so I must be missing something fundamental about
functions. Do you know the Mathematica keyword for the concept I'm missing?

Thanks,
Neil.


  • Prev by Date: Re: Compile and Total
  • Next by Date: Solve never calls Equal?
  • Previous by thread: Re: Compile and Total
  • Next by thread: Re: Compile and Total