CompiledFunction
Usage
• CompiledFunction[args, argregs, nregs, instr, func]代表对一个编译函数求值的编译代码。
Notes
• args 是一个给出了函数的每一个参数类型的模式的列表。类型与在Compile中指定的一样。 • argregs 是一个寄存器列表,实际参数值放在这个寄存器中对编译代码求值。 • nregs 是一个在编译代码求值时所需的逻辑数,整数,实数,复数和张量寄存器的列表。 • instr 是一个实际编译代码指令。 • 不论什么原因,如果没有任何结果从编译代码中获得时,func 是一个将使用的Mathematica纯函数。 • Compile 产生一个应用它到恰当的参数可以执行的CompiledFunction对象, • 明确构造的CompiledFunction 对象也能执行。当这样的对象用Mathematica第一次求值时进行常规检查。 • 在一个CompiledFunction对象中的代码是基于一个理想寄存机器。
Further Examples
This compiles an expression that performs an operation on a matrix.
In[1]:=
|
Out[1]=
|
The list operations are now carried out in a compiled way, and the result is an integer.
In[2]:=
|
Out[2]=
|
|