"PackedArray" (Compiled Type)
"PackedArray"::[type,rank]
represents a packed array type with elements of specified type and rank.
Details
- "PackedArray" can be used in Typed and related constructs to specify a type.
- "PackedArray" objects are automatically memory managed.
- Only elements that have a type of "MachineInteger", "Real64" or "ComplexReal64" can be stored in a "PackedArray".
Constructors
- Packed arrays can be created with List in compiled code. »
- CreateTypeInstance["PackedArray"::[type,rank],array] constructs a copy of array.
- CreateTypeInstance["PackedArray"::[type,1],carr,len] constructs a packed array from a "CArray" carr with length len. carr can optionally be wrapped in "Managed".
Properties
- Information[array,"ContainedType"] for array of type "PackedArray"::[type,1] gives type.
- Information[array,"ContainedType"] for array of type "PackedArray"::[type,rank] gives "PackedArray"::[type,rank-1].
- Information[array,"ElementType"] for array of type "PackedArray"::[type,rank] gives type .
Conversions
- "PackedArray" objects can be converted to and from List objects of the appropriate form. For a List object to be converted to an object of type "PackedArray"::[type,rank], it must represent a rectangular array with the specified rank and element type.
- "PackedArray" objects can be converted to and from "ListVector" objects.
Expressions
"ListVector"
Examples
open all close allBasic Examples (2)
"PackedArray" can be used as an input and output from a CompiledCodeFunction:
Scope (1)
See Also
List NumericArray Typed TypeSpecifier FunctionCompile
Compiled Types: MachineInteger Real64 ComplexReal64 NumericArray ListVector SparseArray
Related Guides
Related Links
History
Introduced in 2019 (12.0) | Updated in 2022 (13.1)