LibraryLink`
LibraryLink`

MTensor_getReal

gets a single element of an MTensor of real type.

更多信息

  • Used in C/C++ code in a library function called from Mathematica.
  • Uses the same numbering scheme as Mathematica parts, i.e. the first element is 1.
  • The array is assumed to have length at least equal to the rank of .
  • A nonzero error code value will be returned if the element does not exist, if is not an MTensor of real type.

范例

基本范例  (1)

This gets the element at position 1,1:

MTensor T0;
mint lens[2];
double res;
int err;
...
lens[0] = 1;
lens[1] = 1;
err = libData->MTensor_getReal( T0, lens, &res);

参见

MTensor_getRealData  MTensor_setReal

教程