Expand description
asdf/core/ndarray.h and asdf/core/datatype.h.
§Why the layouts matter here
asdf_ndarray_t and asdf_datatype_t are not opaque. Callers read
array->ndim and array->shape[0] directly, and libasdf’s own write
example builds an asdf_ndarray_t as a stack literal. So both layouts are
reproduced field for field, and the trailing _reserved pointer is where
this implementation keeps the state it needs.
Structs§
- asdf_
datatype_ t - Mirror of
asdf_datatype_t. - asdf_
ndarray_ t - Mirror of
asdf_ndarray_t.
Enums§
- Ndarray
Err - Error codes matching
asdf_ndarray_err_t.
Functions§
- asdf_
datatype_ ⚠size - The size of one element of a datatype, computing it when left at zero.
- asdf_
get_ ⚠ndarray - Read the array at
path. - asdf_
is_ ⚠ndarray - Whether the value at
pathis an ndarray. - asdf_
ndarray_ ⚠array_ copy - Deep-copy a null-terminated array of ndarrays.
- asdf_
ndarray_ ⚠block - The block underlying an array, or null when its data is inline.
- asdf_
ndarray_ ⚠compression_ set - Set the compression used when the array is written.
- asdf_
ndarray_ ⚠copy - Deep-copy an ndarray into fresh storage.
- asdf_
ndarray_ ⚠copy_ into - Deep-copy an ndarray into caller-provided storage.
- asdf_
ndarray_ ⚠data - The array’s data, decompressed if needed.
- asdf_
ndarray_ ⚠data_ alloc - Allocate a data buffer sized for the array.
- asdf_
ndarray_ ⚠data_ copy - Allocate the array’s buffer and copy
srcinto it. - asdf_
ndarray_ ⚠data_ dealloc - Free a buffer from
asdf_ndarray_data_alloc. - asdf_
ndarray_ ⚠data_ raw - The array’s data as stored, without decompressing.
- asdf_
ndarray_ ⚠deinit - Free an ndarray’s fields without freeing the struct.
- asdf_
ndarray_ ⚠destroy - Free an ndarray handle and everything it owns.
- asdf_
ndarray_ ⚠nbytes - The number of bytes the elements occupy.
- asdf_
ndarray_ ⚠read_ all - Read the whole array, converting to
dst_t. - asdf_
ndarray_ ⚠read_ at - Read one element, converting to
dst_t. - asdf_
ndarray_ ⚠read_ float32_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ float64_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ int8_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ int16_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ int32_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ int64_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ tile_ 2d - Read a 2-D tile, converting to
dst_t. - asdf_
ndarray_ ⚠read_ tile_ ndim - Read an N-dimensional tile, converting to
dst_t. - asdf_
ndarray_ ⚠read_ uint8_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ uint16_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ uint32_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠read_ uint64_ at - Read one element, converted to this type.
- asdf_
ndarray_ ⚠size - The number of elements.
- asdf_
ndarray_ ⚠storage - Where the array’s data will be written.
- asdf_
ndarray_ ⚠storage_ set - Set where the array’s data will be written.
- asdf_
scalar_ ⚠datatype_ from_ string - The scalar type named by a string, or
UNKNOWN. - asdf_
scalar_ datatype_ to_ string - The string naming a scalar type.
- asdf_
set_ ⚠ndarray - Write an ndarray at
path, appending its data as a new block. - asdf_
shim_ ⚠ndarray_ read_ float16_ bits_ at - Read one
float16element, returning its raw bit pattern. - asdf_
value_ ⚠as_ ndarray - Interpret a value as an array.
- asdf_
value_ ⚠is_ ndarray - Whether a value is an ndarray, by its tag.
- asdf_
value_ ⚠of_ ndarray - Build a value for an ndarray, writing its data into a new block.
Type Aliases§
- Byte
Order Abi asdf_byteorder_tas it crosses the boundary.- Scalar
Type Abi asdf_scalar_datatype_tas it crosses the boundary.