specifies the data type for a LibraryFunction argument or result to be datatype.


specifies an element type etype for data structures.


specifies an array depth d for array data types.


  • Possible library data types include:
  • NullNull type (void)
    True | FalseBoolean values (mbool)
    StringUTF8 encoded strings (char *)
    Integermachine integers (mint)
    Realmachine reals (mreal)
    Complexmachine complex numbers (mcomplex)
    Listtensors of numerical values (MTensor)
    NumericArraynumeric arrays for LibraryLink (MNumericArray)
    SparseArraysparse arrays of numerical values for LibraryLink (MSparseArray)
    ByteArraybyte arrays for LibraryLink (MNumericArray)
    Image2D images for LibraryLink (MImage)
    Image3D3D images for LibraryLink (MImage)
    Image|Image3D2D or 3D images for LibraryLink (MImage)
  • For an image datatype, LibraryDataType[datatype,itype] specifies an ImageType of itype; LibraryDataType[datatype] allows any image type.


Basic Examples  (1)

Load an example LibraryFunction that accepts a sparse array argument:

Use the function to get a property from a sparse array:

Introduced in 2014
Updated in 2019