You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `fill` key may be present. If the `fill` key is present, it shall have a
95
95
boolean value. If the value is true, it signifies the presence of a `fill_value`
96
-
array, whose single element defines the fill (zero) value of the sparse tensor,
97
-
or the value of the array at indices not otherwise specified by the sparse
98
-
tensor structure.
96
+
array, whose single element defines the value at indices not specified
97
+
by the sparse tensor structure.
99
98
100
99
Format {#key_format}
101
100
--------------------
@@ -128,15 +127,15 @@ The element of the vector located at index `indices_0[i]` has scalar value
128
127
129
128
Compressed-Sparse Row format
130
129
131
-
: pointers_0
130
+
: pointers_to_1
132
131
:: Array of size `number_of_rows + 1` containing start and end positions by row.
133
132
: indices_1
134
133
:: Array of size `number_of_elements` containing 0-based column indices.
135
134
: values
136
135
:: Array of size `number_of_elements` containing stored values.
137
136
138
137
The column indices of the stored values located in row `i` are located in the range
139
-
`[pointers_0[i], pointers_0[i+1])` in the `indices_1` array. The scalar values for
138
+
`[pointers_to_1[i], pointers_to_1[i+1])` in the `indices_1` array. The scalar values for
140
139
each of those stored values is stored in the corresponding index in the `values` array.
141
140
142
141
Within a row, elements shall be sorted by column index and must not be duplicated.
@@ -145,15 +144,15 @@ Within a row, elements shall be sorted by column index and must not be duplicate
145
144
146
145
Compressed-Sparse Column format
147
146
148
-
: pointers_0
147
+
: pointers_to_1
149
148
:: Array of size `number_of_columns + 1` containing start and end positions by column.
150
149
: indices_1
151
150
:: Array of size `number_of_elements` containing 0-based row indices.
152
151
: values
153
152
:: Array of size `number_of_elements` containing stored values.
154
153
155
154
The rows indices of the stored values located in column `j` are located in the range
156
-
`[pointers_0[j], pointers_0[j+1])` in the `indices_1` array. The scalar values for
155
+
`[pointers_to_1[j], pointers_to_1[j+1])` in the `indices_1` array. The scalar values for
157
156
each of those stored values is stored in the corresponding index in the `values` array.
158
157
159
158
Within a column, elements shall be sorted by row index and must not be duplicated.
@@ -164,16 +163,16 @@ Doubly Compressed-Sparse Row format
164
163
165
164
: indices_0
166
165
:: Array of size `number_of_nonempty_rows` containing 0-based row indices corresponding
167
-
to positions within `pointers_0`.
168
-
: pointers_0
166
+
to positions within `pointers_to_1`.
167
+
: pointers_to_1
169
168
:: Array of size `number_of_nonempty_rows + 1` containing start and end positions.
170
169
: indices_1
171
170
:: Array of size `number_of_elements` containing 0-based column indices.
172
171
: values
173
172
:: Array of size `number_of_elements` containing stored values.
174
173
175
-
DCSR is similar to CSR, except that rows which are entirely empty are not stored. `pointers_0`
176
-
contains no repeated values. Because the position within `pointers_0` no longer dictates the
174
+
DCSR is similar to CSR, except that rows which are entirely empty are not stored. `pointers_to_1`
175
+
contains no repeated values. Because the position within `pointers_to_1` no longer dictates the
177
176
corresponding row index, `indices_0` provides the row index.
178
177
179
178
Rows shall be sorted and must not be duplicated.
@@ -185,16 +184,16 @@ Doubly Compressed-Sparse Column format
185
184
186
185
: indices_0
187
186
:: Array of size `number_of_nonempty_columns` containing 0-based column indices
188
-
corresponding to positions within `pointers_0`.
189
-
: pointers_0
187
+
corresponding to positions within `pointers_to_1`.
188
+
: pointers_to_1
190
189
:: Array of size `number_of_nonempty_columns + 1` containing start and end positions.
191
190
: indices_1
192
191
:: Array of size `number_of_elements` containing 0-based row indices.
193
192
: values
194
193
:: Array of size `number_of_elements` containing stored values.
195
194
196
-
DCSC is similar to CSC, except that columns which are entirely empty are not stored. `pointers_0`
197
-
contains no repeated values. Because the position within `pointers_0` no longer dictates the
195
+
DCSC is similar to CSC, except that columns which are entirely empty are not stored. `pointers_to_1`
196
+
contains no repeated values. Because the position within `pointers_to_1` no longer dictates the
198
197
corresponding column index, `indices_0` provides the column index.
199
198
200
199
Columns shall be sorted and not duplicated.
@@ -317,11 +316,11 @@ Assume that this level represents `n`-dimensional subarrays and the root array
317
316
is `N`-dimensional. The sparse level implies the following binary arrays are
318
317
present:
319
318
320
-
: pointers_(N - n - 1)
321
-
:: Array of size `number_of_positions + 1` whose 1st element is equal to `0` and whose `p + 1`th element is equal to the sum of `pointers_N[p]` and the number of explicitly represented slices in the `p`th position.
319
+
: pointers_to_(N - n)
320
+
:: Array of size `number_of_positions + 1` whose 1st element is equal to `0` and whose `p + 1`th element is equal to the sum of `pointers_to_(N - n)[p]` and the number of explicitly represented slices in the `p`th position.
322
321
323
322
: indices_(N - n), ..., indices(N - n + r - 1)
324
-
:: There are `r` such arrays. When `A[i_0, ..., i_(r - 1), :, ..., :]` is explicitly represented by the subarray in position `q`, `indices_(N-n+s)[q] = i_s`. The arrays must be ordered such that the tuples `(indices_(N-n)[q], ..., indices_(N-n+r-1)[q])` are unique and appear in lexicographic order for all `q` in each range `pos[p] <= q < pos[p + 1]`. This array must contain no other elements.
323
+
:: There are `r` such arrays. When `A[i_0, ..., i_(r - 1), :, ..., :]` is explicitly represented by the subarray in position `q`, `indices_(N-n+s)[q] = i_s`. The arrays must be ordered such that the tuples `(indices_(N-n)[q], ..., indices_(N-n+r-1)[q])` are unique and appear in lexicographic order for all `q` in each range `pointers_to_(N-n)[p] <= q < pointers_to_(N-n)[p + 1]`. This array must contain no other elements.
325
324
326
325
Special note: If the sparse level is the root level, the `pointers` array should
327
326
be ommitted, as its first value will be `0` and its last value will be the
@@ -596,14 +595,14 @@ Example of a CSR Matrix whose values are all 7.
596
595
},
597
596
"shape": [5, 5],
598
597
"data_types": {
599
-
"pointers_0": "uint64",
598
+
"pointers_to_1": "uint64",
600
599
"indices_1": "uint64",
601
600
"values": "iso[int8]"
602
601
}
603
602
}
604
603
```
605
604
606
-
- `pointers_0` = [0, 1, 3, 3, 5, 6]
605
+
- `pointers_to_1` = [0, 1, 3, 3, 5, 6]
607
606
- `indices_1` = [3, 1, 4, 1, 2, 3]
608
607
- `values` = [7]
609
608
@@ -613,6 +612,139 @@ Note: Structure-only matrices (allowed in matrix market format) can be stored
613
612
using this technique with a value of 1. This adds only a small amount of
614
613
overhead while describing essentially the same matrix.
615
614
615
+
Structure {#key_structure}
616
+
--------------------------
617
+
The `structure` key, if present, denotes a special matrix structure in which
618
+
only one triangle of the matrix is stored and the structure and values in the
0 commit comments