Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: Compile and Total


A small correction to my previous mail: it is superfluous to substitute 
the external definitions in the expression to be compiled. The following 
is simply better:

<<CompiledFunctionTools`;

g=Total;
gC=Compile[{{x,_Real,1}},g[x],CompilationOptions->{"InlineExternalDefinitions"->True}];
CompilePrint[gC]

h=#/Total[#]&;
hC=Compile[{{x,_Real,1}},h[x],CompilationOptions->{"InlineExternalDefinitions"->True}];
CompilePrint[hC]

-- 
Fred Simons
Eindhoven University of Technology



  • Prev by Date: Re: Compile and Total
  • Next by Date: Re: Compile and Total
  • Previous by thread: Re: Compile and Total
  • Next by thread: Re: Compile and Total