This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MATHEMATICA LIBRARYLINK C FUNCTION|Tutorials »

MTensor_clone


is a library callback function that puts a clone of into .
  • Used in C/C++ code in a library function called from Mathematica.
  • A nonzero error code value will be returned if the dimensions are negative or if there is not sufficient memory.
  • The destination should either be null (0) or an MTensor allocated with MTensor_new.
  • If is null then a new MTensor is created.
  • If is an allocated MTensor then the data in will be modified.
This clones an MTensor:
This clones an MTensor:
MTensor T0, T1;
int err;
...
T1 = 0;
err = libData->MTensor_clone( T0, &T1);