WSPutReal32Array (C 函数)
int WSPutReal32Array(WSLINK link,float *a,int *dims,char **heads,int d)
把一单精度浮点数数组写入由 link 指定的 WSTP 连接中形成深度为 d,维数为 dims 的数组.
范例
基本范例 (1)
#include "wstp.h"
/* put an array of single-precision floating-point numbers to a link */
void f(WSLINK lp)
{
float array[2][10][2];
long dims[3];
int i;
for(i = 0; i < 40; i++)
*((float *)array +i) = i + .2;
dims[0] = 2;
dims[1] = 10;
dims[2] = 2;
if(! WSPutReal32Array(lp, (float *)array, (int *)dims, (char **)0, 3))
{ /* unable to send the array to lp */ }
}