|
SOLUTIONS
|
MLPutInteger64Array()
詳細詳細
- 配列 a は,mlint64
と明示的に宣言されたC言語の配列のようにメモリにレイアウトされなければならない. - heads がNULLとして与えられる場合,配列は各レベルにおいて頭部Listを持つと見なされるようになる.
- レベル i での配列の長さは
であるとされる. - MLPutInteger64Array()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと,MLPutInteger64Array()が不成功の場合にエラーコードを引き出すことができる.
- MLPutInteger64Array()は MathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (1)
#include "mathlink.h"
/* send an array of 64-bit numbers to a link */
void f(MLINK lp)
{
mlint64 array[2][10][2][5];
int dims[4];
int i;
for(i = 0; i < 200; i++)
{
#if ML64BIT_MATHLINK
/* this machine is a 64-bit machine */
*((mlint64 *)array + i) = i;
#else
/* this machine is a 32-bit machine */
((mlint64 *)array + i)->hi = 0;
((mlint64 *)array + i)->low = i;
#endif
}
dims[0] = 2;
dims[1] = 10;
dims[2] = 2;
dims[3] = 5;
if(! MLPutInteger64Array(lp, (mlint64 *)array, (int *)dims, (char **)0, 4))
{ /* unable to send the array to lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
