Skip to content

Commit da6526a

Browse files
author
Willow Ahrens
committed
Merge branch 'wma/types' into wma/levels
2 parents a3d2b95 + d166ca9 commit da6526a

1 file changed

Lines changed: 47 additions & 10 deletions

File tree

spec/latest/index.bs

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -471,25 +471,62 @@ Data Types {#key_data_types}
471471

472472
The `data_types` key must be present and shall define the data types of all required
473473
arrays based on the [[#key_format]]. The data type declares the type of both the
474-
on-disk array as well as the in-memory array. When these are identical, a simple string
475-
defines the type. When the on-disk and in-memory types differ due to limitations in the
476-
storage container (ex. HDF5 lacks a BOOL type), the type is shown as "on_disk->in_memory".
477-
For the example of storing BOOL type as INT8, this would be "int8->bool" to indicate that
478-
after reading the values array into memory, it should be interpreted as boolean data.
474+
on-disk array as well as the in-memory array.
479475

480476
For a given [[#key_format]], all named binary arrays for that format shall have a
481477
corresponding name in `data_types`.
482478

479+
The following strings shall be used to describe data types:
480+
: "uint8"
481+
:: unsigned 8-bit integer
482+
: "uint16"
483+
:: unsigned 16-bit integer
484+
: "uint32"
485+
:: unsigned 32-bit integer
486+
: "uint64"
487+
:: unsigned 64-bit integer
488+
: "int8"
489+
:: signed 8-bit integer
490+
: "int16"
491+
:: signed 16-bit integer
492+
: "int32"
493+
:: signed 32-bit integer
494+
: "int64"
495+
:: signed 64-bit integer
496+
: "float32"
497+
:: IEEE binary32 floating point number
498+
: "float64"
499+
:: IEEE binary64 floating point number
500+
: "bint8"
501+
:: An unsigned 8-bit integer, to be reinterpreted as a Boolean number, however
502+
that is represented in the host language. The value 0 shall map to false and the
503+
value 1 shall map to true. When parsing, implementations may choose to interpret
504+
values other than 0 or 1 as true, or throw an error.
505+
506+
## Value Modifiers ## {#value_modifiers}
507+
508+
When the value array is meant to be reinterpreted before reading, a special bracket syntax is
509+
provided to indicate modifications to the underlying value array.
510+
511+
### Sparse Array with Complex Values ### {#complex_arrays}
512+
513+
When a value array is composed of alternating real and imaginary components of
514+
complex numbers, the type is written as `complex[<type>]`. For example, a value
515+
array of complex `float64` would have a datatype of `complex[float64]` The real
516+
component of the `i`th element in the modified array shall be stored at position
517+
`2i` in the original array, and the imaginary component of the `i`th element in
518+
the modified array shall be at position `2i + 1` in the underlying array.
519+
483520
### Sparse Array with All Values the Same ### {#iso_arrays}
484521

485-
When all values of a sparse array are the same identical value, a special syntax is
486-
provided to compress the value array to a single value rather than duplicating the same
487-
number unnecessarily. The type is written as `iso[<type>]` to indicate that the array
488-
will store only a single element which is common to all stored indices.
522+
When all values of a sparse array are the same identical value, the type is
523+
written as `iso[<type>]`. This indicates that the array will store only a single
524+
element which is common to all stored indices. All elements in the modified
525+
array shall be stored at position 0 of the underlying array.
489526

490527
<div class=example>
491528

492-
Example of a CSR Matrix whose values are all 1.
529+
Example of a CSR Matrix whose values are all 7.
493530

494531
<table>
495532
<thead>

0 commit comments

Comments
 (0)