@@ -88,6 +88,12 @@ contain the vector's dimension.
8888Note: a matrix has shape [`number_of_rows`, `number_of_columns`] regardless of whether
8989the format orientation is row-wise or column-wise.
9090
91+ Fill {#key_fill}
92+ --------------------
93+ The `fill` key may be present. If the `fill` key is present, it shall have a
94+ boolean value. If the value is true, it signifies the presence of a `fill_value`
95+ array, whose single element defines the value at indices not specified
96+ by the sparse tensor structure.
9197
9298Format {#key_format}
9399--------------------
@@ -229,21 +235,58 @@ Data Types {#key_data_types}
229235
230236The `data_types` key must be present and shall define the data types of all required
231237arrays based on the [[#key_format]] . The data type declares the type of both the
232- on-disk array as well as the in-memory array. When these are identical, a simple string
233- defines the type. When the on-disk and in-memory types differ due to limitations in the
234- storage container (ex. HDF5 lacks a BOOL type), the type is shown as "on_disk->in_memory".
235- For the example of storing BOOL type as INT8, this would be "int8->bool" to indicate that
236- after reading the values array into memory, it should be interpreted as boolean data.
238+ on-disk array as well as the in-memory array.
237239
238240For a given [[#key_format]] , all named binary arrays for that format shall have a
239241corresponding name in `data_types`.
240242
243+ The following strings shall be used to describe data types:
244+ : "uint8"
245+ :: unsigned 8-bit integer
246+ : "uint16"
247+ :: unsigned 16-bit integer
248+ : "uint32"
249+ :: unsigned 32-bit integer
250+ : "uint64"
251+ :: unsigned 64-bit integer
252+ : "int8"
253+ :: signed 8-bit integer
254+ : "int16"
255+ :: signed 16-bit integer
256+ : "int32"
257+ :: signed 32-bit integer
258+ : "int64"
259+ :: signed 64-bit integer
260+ : "float32"
261+ :: IEEE binary32 floating point number
262+ : "float64"
263+ :: IEEE binary64 floating point number
264+ : "bint8"
265+ :: An unsigned 8-bit integer, to be reinterpreted as a Boolean number, however
266+ that is represented in the host language. The value 0 shall map to false and the
267+ value 1 shall map to true. When parsing, implementations may choose to interpret
268+ values other than 0 or 1 as true, or throw an error.
269+
270+ ## Value Modifiers ## {#value_modifiers}
271+
272+ When the value array is meant to be reinterpreted before reading, a special bracket syntax is
273+ provided to indicate modifications to the underlying value array.
274+
275+ ### Sparse Array with Complex Values ### {#complex_arrays}
276+
277+ When a value array is composed of alternating real and imaginary components of
278+ complex numbers, the type is written as `complex[<type>] `. For example, a value
279+ array of complex `float64` would have a datatype of `complex[float64] ` The real
280+ component of the `i`th element in the modified array shall be stored at position
281+ `2i` in the original array, and the imaginary component of the `i`th element in
282+ the modified array shall be at position `2i + 1` in the underlying array.
283+
241284### Sparse Array with All Values the Same ### {#iso_arrays}
242285
243- When all values of a sparse array are the same identical value, a special syntax is
244- provided to compress the value array to a single value rather than duplicating the same
245- number unnecessarily. The format of the array is written as `iso [<format>] ` to indicate
246- that the array will store only a single element which is common to all stored indices .
286+ When all values of a sparse array are the same identical value, the type is
287+ written as `iso [<type>] `. This indicates that the array will store only a single
288+ element which is common to all stored indices. All elements in the modified
289+ array shall be stored at position 0 of the underlying array .
247290
248291<div class=example>
249292
@@ -306,12 +349,12 @@ Example of a CSR Matrix whose values are all 7.
306349
307350```json
308351{
309- "format": "iso\ [ CSR] ",
352+ "format": "CSR",
310353 "shape": [5, 5] ,
311354 "data_types": {
312355 "pointers_0": "uint64",
313356 "indices_1": "uint64",
314- "values": "int8"
357+ "values": "iso [ int8] "
315358 }
316359}
317360```
0 commit comments