Re: Built-in functions to C code
- To: mathgroup at smc.vnet.net
- Subject: [mg31623] Re: Built-in functions to C code
- From: "Tom Hardy" <tomhardy at COX.RR.COM>
- Date: Sun, 18 Nov 2001 06:29:07 -0500 (EST)
- References: <9sig31$aur$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Use compile in Mathematica, Example: In[29]:=F[x_]:=x^3*Cos[x]*(x^3*Sin[x]); CompiledIntegrate= Compile[{{LowerLimit,_Real},{UpperLimit,_Real}}, NIntegrate[F[x],{x,LowerLimit,UpperLimit}]] CompiledIntegrate[0,10] NIntegrate[F[x],{x,0,10}] Out[30]=CompiledFunction[{LowerLimit,UpperLimit}, NIntegrate[F[x],{x,LowerLimit,UpperLimit}],-CompiledCode-] Out[31]=-29501.5 Out[32]=-29501.5 "Toshiyuki (Toshi) Meshii" <meshii at mech.fukui-u.ac.jp> wrote in message news:9sig31$aur$1 at smc.vnet.net... > Hello, > > I have a program written in Mathematica. > Since It takes long time in calculating NIntegrate, I was wondering whether > I can translate my program to C-language. > > I know there is a command called CForm, but it does not translate NIntegrate > to an detailed C code. > Can someone help me on my problem? > > -Toshi > >