"FunctionType" ()
"FunctionType" ()
{ty1, ty2, …}tyres
指定された引数と結果の型を持つ関数型を表す.
詳細
- 関数型はTypedおよび型を指定する関連した構造で使うことができる.
変換
- CompiledCodeFunction式は.関数型のコンパイルコード要素に変換することができる.
- 関数型を表すコード要素は式に変換することができる.
式から
式へ
例題
例 (1)
関数型はCompiledCodeFunctionの入力として使うことができる.引数として"MachineInteger"を取る関数を作成する:
cf1 = FunctionCompile[Function[Typed[arg, "MachineInteger"], arg + 1]]cf2 = FunctionCompile[Function[{Typed[fun, {"MachineInteger"} -> "MachineInteger"], Typed[arg, "MachineInteger"]}, fun[arg]]]cf2[cf1, 10]テクニカルノート
履歴
2019 で導入 (12.0)