LibraryDataType

LibraryDataType[datatype]

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

LibraryDataType[datatype,etype]

specifies an element type etype for data structures.

LibraryDataType[datatype,etype,d]

specifies an array depth d for array data types.

Details

  • 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.

Examples

Basic Examples  (1)

Load an example LibraryFunction that accepts a sparse array argument:

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

Wolfram Research (2014), LibraryDataType, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryDataType.html (updated 2019).

Text

Wolfram Research (2014), LibraryDataType, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryDataType.html (updated 2019).

CMS

Wolfram Language. 2014. "LibraryDataType." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/LibraryDataType.html.

APA

Wolfram Language. (2014). LibraryDataType. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LibraryDataType.html

BibTeX

@misc{reference.wolfram_2024_librarydatatype, author="Wolfram Research", title="{LibraryDataType}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/LibraryDataType.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_librarydatatype, organization={Wolfram Research}, title={LibraryDataType}, year={2019}, url={https://reference.wolfram.com/language/ref/LibraryDataType.html}, note=[Accessed: 21-November-2024 ]}