Re: Compile and Total
- To: mathgroup at smc.vnet.net
- Subject: [mg120282] Re: Compile and Total
- From: Fred Simons <f.h.simons at tue.nl>
- Date: Sat, 16 Jul 2011 05:42:54 -0400 (EDT)
- References: <201107150120.VAA23682@smc.vnet.net> <201107150809.EAA26806@smc.vnet.net>
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
- References:
- Compile and Total
- From: Neil Stewart <neil.stewart@warwick.ac.uk>
- Re: Compile and Total
- From: DrMajorBob <btreat1@austin.rr.com>
- Compile and Total