"ListVector" (Compiled Type)
"ListVector"::[type]
represents a uniform list with the specified element type.
Details
- "ListVector" can be used in Typed and related constructs to specify a type.
- The elements of a "ListVector" can have any compiled type.
- The elements of a "ListVector" all have the same type.
- For numerical tensors with rank greater than 1, "PackedArray" or "NumericArray" can be used.
Constructors
- "ListVector" objects can be constructed with Typed[{…},"ListVector"::[type]] in compiled code. »
- CreateTypeInstance["ListVector"::[type],carr,len] constructs a "ListVector" from a "CArray" carr with length len. carr can optionally be wrapped in "Managed".
Properties
- Information[list,"ElementType"] for list of type "ListVector"::[type] gives type.
Conversions
- List expressions can be converted to and from "ListVector"::[type] as long as every element of the list can be converted to type.
- "ListVector" objects can be converted to and from "PackedArray" objects.
- "ListVector" objects can be converted to and from "NumericArray" objects.
Expressions
"PackedArray"
"NumericArray"
Examples
open allclose allBasic Examples (2)
"ListVector" can be used as input or output for a CompiledCodeFunction:
Scope (3)
Properties & Relations (1)
The "PackedArray" can be used to represent numerical arrays:
However, it cannot be used for non-numerical data:
In contrast, the "ListVector" type can only represent rank-1 lists, but it can have elements with any compilable type: