Skip to content

Commit 1ea8efd

Browse files
committed
Add example of symmetric matrix
1 parent d8d77d7 commit 1ea8efd

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

spec/latest/index.bs

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,84 @@ with only the upper triangle stored. For all matrix entries with row and column
381381
indices `i,j` and value `v`, `i <= j`. If `i != j`, the entry implies the
382382
presence of an entry at row and column index `j,i` with value `-v`.
383383

384+
<div class=example>
385+
386+
Example of a symmetric CSR matrix.
387+
388+
<table>
389+
<thead>
390+
<tr>
391+
<th> </th>
392+
<th>0</th>
393+
<th>1</th>
394+
<th>2</th>
395+
<th>3</th>
396+
<th>4</th>
397+
</tr>
398+
</thead>
399+
<tbody>
400+
<tr>
401+
<th>0</th>
402+
<td>1</td>
403+
<td>.</td>
404+
<td>.</td>
405+
<td>.</td>
406+
<td>.</td>
407+
</tr>
408+
<tr>
409+
<th>1</th>
410+
<td>2</td>
411+
<td>9</td>
412+
<td>.</td>
413+
<td>.</td>
414+
<td>.</td>
415+
</tr>
416+
<tr>
417+
<th>2</th>
418+
<td>7</td>
419+
<td>.</td>
420+
<td>2</td>
421+
<td>.</td>
422+
<td>.</td>
423+
</tr>
424+
<tr>
425+
<th>3</th>
426+
<td>.</td>
427+
<td>2</td>
428+
<td>.</td>
429+
<td>3</td>
430+
<td>.</td>
431+
</tr>
432+
<tr>
433+
<th>4</th>
434+
<td>.</td>
435+
<td>.</td>
436+
<td>3</td>
437+
<td>.</td>
438+
<td>7</td>
439+
</tr>
440+
</tbody>
441+
</table>
442+
443+
```json
444+
{
445+
"format": "CSR",
446+
"shape": [5, 5],
447+
"structure": "symmetric_lower",
448+
"data_types": {
449+
"pointers_0": "uint64",
450+
"indices_1": "uint64",
451+
"values": "int8"
452+
}
453+
}
454+
```
455+
456+
- `pointers_0` = [0, 1, 3, 5, 7, 9]
457+
- `indices_1` = [0, 0, 1, 0, 2, 1, 3, 2, 4]
458+
- `values` = [1, 2, 9, 7, 2, 2, 3, 3, 7]
459+
460+
</div>
461+
384462
Binary Containers {#binary_container}
385463
=====================================
386464
Binary containers must store binary arrays in a standardized, cross-platform

0 commit comments

Comments
 (0)