LIBRARY LINK 符号

MTensor_getMTensor


gets a subtensor element from an MTensor.

更多信息更多信息

  • 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 .
  • A nonzero error code value will be returned if the element does not exist or if the rank of is not at least as big as .
  • The destination * should either be null (0) or an MTensor allocated with MTensor_new.

范例范例打开所有单元关闭所有单元

基本范例 (1)基本范例 (1)

This gets the element at position 1,1 copying into an MTensor result:

MTensor T0, T1 = 0;
mint lens[2];
int err;
...
lens[0] = 1;
lens[1] = 1;
err = funStruct->MTensor_getMTensor( T0, lens, 2, &T1);
New to Mathematica? Find your learning path »
Have a question? Ask support »