"PackedArray" (Compiled Type)


represents a packed array composite type with elements of specified type and rank.


  • "PackedArray" can be used in Typed and related constructs to specify a type.


Expression Conversions

    From Expressions

  • List expressions of appropriate form can be converted into compiled code elements with types created with "PackedArray". They must be rectangular and contain uniform elements of machine integer, machine real or machine complex real.
  • To Expressions

  • Compiled code elements with types created with "PackedArray" can be converted into List expressions.

Runtime Errors


  • Elements with types constructed from "PackedArray" can give a runtime error if used in an operation that extracts or sets parts.


Basic Examples  (3)

"PackedArray" can be used as an input and output from a CompiledCodeFunction:

Part access can cause an error while running the function. The computation is terminated, a message is issued and the Wolfram Engine is used to compute the result:

"MachineInteger" is useful for working with "PackedArray", since this takes integers of the native size for the architecture:

Introduced in 2019