LibraryLink`
LibraryLink`

MNumericArray_getType (C Function)

gets the type of an MNumericArray.

Details

  • Used in C/C++ code in a library function called from the Wolfram Language.
  • Returns one of:
  • MNumericArray_Type_Bit8"Integer8"signed 8-bit integers from through
    MNumericArray_Type_UBit8"UnsignedInteger8"integers 0 through 255
    MNumericArray_Type_Bit16"Integer16"signed 16-bit integers from through
    MNumericArray_Type_UBit16"UnsignedInteger16"integers 0 through 65535
    MNumericArray_Type_Bit32"Integer32"signed 32-bit integers from through
    MNumericArray_Type_UBit32"UnsignedInteger32"integers 0 through 2^(32)-1
    MNumericArray_Type_Bit64"Integer64"signed 64-bit integers from through
    MNumericArray_Type_UBit64"UnsignedInteger64"integers 0 through 2^(64)-1
    MNumericArray_Type_Real32"Real32"single-precision reals (32-bit)
    MNumericArray_Type_Real64"Real64"double-precision reals (64-bit)
    MNumericArray_Type_Complex_Real32"ComplexReal32"single-precision complex numbers
    MNumericArray_Type_Complex_Real64"ComplexReal64"double-precision complex numbers

Examples

Basic Examples  (1)

This checks if a given MNumericArray is of type MNumericArray_Type_UBit8:

MNumericArray A0;
numericarray_data_t type;
...
type = libData->numericarrayLibraryFunctions->MNumericArray_getType(A0);
if (type != MNumericArray_Type_UBit8) {
processError();
}