CompiledComponent
CompiledComponent[name]
コンパイルされたコンポーネントを表す.
詳細
- コンパイルされたコンポーネントを使ってコンパイラ宣言の名前付きグループを表すことができる.
- コンパイルされたコンポーネントを使って共有ライブラリに組み込むことができるコンパイルされた機能を表すことができる.
- コンパイルされたコンポーネントはパクレットに埋め込むことができる.
- コンパイルされたコンポーネントはDeclareCompiledComponentによって作成される.
- CompiledComponentオブジェクトを使ってコンパイルに宣言を加えることができる.
- CompiledComponentオブジェクトを使ってコンパイルされたコンポーネントの詳細が見付けられる.
- CompiledComponentオブジェクトはDeleteObjectで作成される. »
- コンパイルされたコンポーネントのフィールドにはCompiledComponent[name][field]でアクセスできる.
- CompiledComponent[name][All]はコンポーネント内の全フィールドの連想を返す.
- コンパイルされたコンポーネントは以下のフィールドを含んでいるが,これはDeclareCompiledComponentで変更できる.
-
"Declarations" コンポーネントで使う宣言 "InstalledFunctions" コンパイルする関数と結果をインストールするシンボル "LibraryFunctions" コンパイルする関数.LoadCompiledComponentで復元される "RawLibraryFunctions" ライブラリエキスポートとして使用可能な,コンパイルする関数 "LoadingEpilogs" LoadCompiledComponentでコンポーネントをロードした後で実行する関数 "ExternalLibraries" LoadCompiledComponentでコンポーネントをロードする前にロードするライブラリ - "InstalledFunctions"フィールドおよび"LibraryFunctions"フィールドはコンパイルされるソースを含んでいる.BuildCompiledComponentはそのソースをビルドして結果を動的ライブラリに保存する.動的ライブラリはLoadCompiledComponentでロードしてコンパイルの結果を復元できる.
例題
すべて開く すべて閉じる例 (2)
宣言を含むコンパイルされたコンポーネント"demo"を作成する:
DeclareCompiledComponent["demo", FunctionDeclaration[square, Typed[{"Real64"} -> "Real64"]@Function[x, x ^ 2]]];CompiledComponent["demo"]FunctionCompileの呼出しの中でCompiledComponentを使う:
comp = FunctionCompile[CompiledComponent["demo"], Function[Typed[arg, "Real64"], square[arg]]]comp[10]DeleteObject[CompiledComponent["demo"]]DeclareCompiledComponent["demo2", FunctionDeclaration[multiply12, Typed[{"Real64"} -> "Real64"]@Function[x, x * 12]]];CompiledComponentを使ってコンパイラ環境に宣言を加える:
CompilerEnvironmentAppendTo[CompiledComponent["demo2"]];コンポーネントからの関数を使ってプログラムをコンパイルする:
comp = FunctionCompile[Function[Typed[arg, "Real64"], multiply12[arg]]]comp[10]スコープ (1)
DeclareCompiledComponent["fullComponent", {
FunctionDeclaration[return12, Typed[{} -> "MachineInteger"]@Function[{}, 12]],
FunctionDeclaration[addtwo, Typed[{"MachineInteger"} -> "MachineInteger"]@Function[x, x + 2]]
}];DeclareCompiledComponent["fullComponent", "LibraryFunctions" -> <|
"libFunc" -> Function[Typed[arg, "Real64"], Sqrt[arg]]
|>];DeclareCompiledComponent["fullComponent", "InstalledFunctions" -> addtwo];CompiledComponent["fullComponent"][All]CompiledComponent["fullComponent"]["Properties"]CompiledComponent["fullComponent"]["Declarations"]DeleteObject[CompiledComponent["fullComponent"]]テクニカルノート
関連するガイド
テキスト
Wolfram Research (2022), CompiledComponent, Wolfram言語関数, https://reference.wolfram.com/language/ref/CompiledComponent.html.
CMS
Wolfram Language. 2022. "CompiledComponent." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompiledComponent.html.
APA
Wolfram Language. (2022). CompiledComponent. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompiledComponent.html
BibTeX
@misc{reference.wolfram_2026_compiledcomponent, author="Wolfram Research", title="{CompiledComponent}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/CompiledComponent.html}", note=[Accessed: 15-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_compiledcomponent, organization={Wolfram Research}, title={CompiledComponent}, year={2022}, url={https://reference.wolfram.com/language/ref/CompiledComponent.html}, note=[Accessed: 15-October-2026]}