Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Functions > Built-in & external > external

external

Scilabオブジェクト, 外部関数またはルーチン

説明

特定のコマンドで使用する外部関数またはルーチン.

"external" は, (ode, optim, schur... のような) いくつかの高レベルプリミティブの引数として使用される 関数またはルーチンです.

external (関数またはルーチン)の呼び出し手順は, external の引数を設定する高レベルプリミティブにより 規定されています.

例えば, 外部関数 costfunc は, optim プリミティブの引数です. その呼出し手順は次のようになります: [f,g,ind]=costfunc(x,ind) そして optim (高レベル最適化プリミティブ)は 以下のようにコールされます

optim(costfunc,...)

ここで, costfunc (評価関数はプリミティブ optimにより最小化されます)は, f=f(x) およびxにおける fの傾きgを評価します (ind は整数です. その使用法は optimヘルプに詳述されています).

その他の値が外部関数により必要とされる場合, これらの変数をその環境において定義することができます. また, 外部関数をリスト内に置くことができます. 例えば,外部関数

[f,g,ind]=costfunc(x,ind,a,b,c)

は, external が list(costfunc,a,b,c)の場合, optimに適用できます. そして, optimへのコールは 以下のようになります:

optim(list(costfunc,a1,b1,c1),....

externalはFortranまたはCルーチンとすることもできます: これは計算を高速化するために有用です.

ルーチンの名前は文字列として高レベルプリミティブに 指定することができます. このルーチンの呼び出し手順も規定されています.

外部FortranまたはCルーチンも動的にリンクできます (link参照).

参照

  • ode — 常微分方程式ソルバ
  • optim — non-linear optimization routine
  • impl — 微分代数方程式
  • dassl — 微分代数方程式
  • intg — 定積分
  • schur — 行列およびペンシルの[ソートされた] Schur 分解
Report an issue
<< clearfun Built-in & external funptr >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:10:43 CET 2017