Arrays#

type vx_array#

Arrays are reference-counted handles to owned memory buffers that hold scalars. These buffers can be held in a number of physical encodings to perform lightweight compression that exploits the particular data distribution of the array’s values.

Every data type recognized by Vortex also has a canonical physical encoding format, which arrays can be canonicalized into for ease of access in compute functions.

As an implementation detail, vx_array Arc’ed inside, so cloning an array is a cheap operation.

Unless stated explicitly, all operations with vx_array don’t take ownership of it, and thus it must be freed by the caller.

const vx_array *vx_array_clone(const vx_array *ptr)#

Clone a borrowed vx_array, returning an owned vx_array.

Must be released with vx_array_free().

void vx_array_free(const vx_array *ptr)#

Free an owned vx_array object.

Properties#

size_t vx_array_len(const vx_array *array)#

Get the length of the array.

const vx_dtype *vx_array_dtype(const vx_array *array)#

Get the vx_dtype of the array.

The returned pointer is valid as long as the array is valid. Do NOT free the returned dtype pointer - it shares the lifetime of the array.