|
SOLUTIONS
|
MATHEMATICA MATHLINK C 関数
MLEvaluate()
int MLEvaluate(MLINK link, char*string)
ToExpression[]との使用に適した入力の文字列をMathematica に送信し,評価させる.
詳細詳細
- MLEvaluateString()と違ってMLEvaluate()は,応答として送られたパケットを放棄しない.
- MLEvaluate()はmprep MathLink templateプログラム内に限って使用可能である.
- MLEvaluate()は不成功の場合に0を返し,成功の場合には0以外の値を返す.
- MLEvaluate()はMathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (1)
:Begin:
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual
:End:
#include "mathlink.h"
/* read the Kernel's response to its evaluation of
{Date[], $TimeZone} */
void f(void)
{
if(! MLEvaluate(stdlink, "{Date[],$TimeZone}"))
{ /* unable to send the expression to stdlink */ }
/* now read the Kernel's response */
switch(MLGetType(stdlink))
{
/* ... */
}
/* ... */
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
