MSparseArray_fromMTensor (C Function)

is a library callback function that converts from the ordinary t to an MSparseArray and puts the result in *r.


  • Used in C/C++ code in a library function called from the Wolfram Language.
  • A nonzero error code value will be returned if there is not sufficient memory or the inputs are inconsistent.
  • The destination *r should either be null (0) or an MSparseArray object.
  • A new MSparseArray is created. If *r is not null then the memory will be freed before creating the new result.
  • The implicit value imp should either be null (0) or a rank-0 having type consistent with the type of vals. If imp is null the implicit value is taken to be 0.