Compile
Compile(list-of-arguments}, expression)compile the
expressioninto a Java function, which has the arguments defined inlist-of-argumentsand return the compiled result in anCompiledFunctionexpression.
Examples
Compile the expression into a CompiledFunction and assign it to f:
>> f=Compile({{x, _Real}}, E^3-Cos(Pi^2/x));
>> f(1.4567)19.20421
>> f = Compile({{n, _Integer}}, Module({p = Range(n),i,x,t}, Do(x = RandomInteger({1,i}); t = p[[i]]; p[[i]] = p[[x]]; p[[x]] = t,{i,n,2,-1}); p));
>> f(4)Related terms
CompiledFunction, CompilePrint, OptimizeExpression
Implementation status
- ☕ - supported on Java virtual machine