LibraryLink`
LibraryLink`

MTensor_getComplex (C Function)

gets a single element of an MTensor of complex type.

Details

  • Used in C/C++ code in a library function called from the Wolfram Language.
  • Uses the same numbering scheme as the Wolfram Language 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 complex type.

Examples

Basic Examples  (1)

This gets the element at position 1,1 for a complex-valued matrix:

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