@@ -296,22 +296,21 @@ operator). We can represent a collection of sparse vectors using a sparse level.
296296The sparse level format represents sparse vectors by listing the locations of
297297nonzeros, and storing only the nonzero scalars inside an element level.
298298
299-
300299In addition to storing scalars, dense and sparse levels may themselves store
301300multidimensional arrays. This leads to multiple ways to store sparse matrices
302301and tensors. For example, a dense vector of sparse vectors is equivalent to the
303302CSR matrix format, and a sparse vector of sparse vectors is equivalent to the
304303hypersparse DCSR matrix format.
305304
306- When defining a custom format, the `format ` key is defined as the root level
307- descriptor (a level which will only hold one array). If a level holds many
308- different arrays, we refer to the `p`th array as the array in position `p`.
305+ When defining a custom format, the outermost `subformat ` key is defined as the
306+ root level descriptor (a level which will only hold one array). If a level holds
307+ many different arrays, we refer to the `p`th array as the array in position `p`.
309308
310309Levels are row-major by default (adding an outer level adds a row dimension).
311- The format descriptor may optionally define a `swizzle ` key, equal to a list of
310+ The format descriptor may optionally define a `transpose ` key, equal to a list of
312311the described dimensions in the order they should appear. If the tensor we wish
313312to represent is `A` and the tensor described by the format descriptor is `B`,
314- then `A[i_1, ..., i_n] = B[i_(swizzle [1] ), ..., i_(swizzle [n] )]`. `swizzle ` must
313+ then `A[i_1, ..., i_n] = B[i_(transpose [1] ), ..., i_(transpose [n] )]`. `transpose ` must
315314be a permutation.
316315
317316If the format key is a dictionary, the `level` key must be present and shall
@@ -377,22 +376,22 @@ The following formats are equivalent
377376#### DVEC #### {#dvec_format_equiv}
378377
379378```json
380- {
381- "format ": {
379+ "format": {
380+ "subformat ": {
382381 "level": "dense",
383382 "rank": 1,
384383 "subformat": {
385384 "level": "element",
386385 }
387- },
386+ }
388387}
389388```
390389
391390#### DMATR #### {#dmatr_format_equiv}
392391
393392```json
394- {
395- "format ": {
393+ "format": {
394+ "subformat ": {
396395 "level": "dense",
397396 "rank": 1,
398397 "subformat": {
@@ -401,17 +400,17 @@ The following formats are equivalent
401400 "subformat": {
402401 "level": "element",
403402 }
404- },
405- },
403+ }
404+ }
406405}
407406```
408407
409408#### DMATC #### {#dmatr_format_equiv}
410409
411410```json
412- {
413- "swizzle ": [1, 0]
414- "format ": {
411+ "format": {
412+ "transpose ": [1, 0] ,
413+ "subformat ": {
415414 "level": "dense",
416415 "rank": 1,
417416 "subformat": {
@@ -420,30 +419,30 @@ The following formats are equivalent
420419 "subformat": {
421420 "level": "element",
422421 }
423- },
424- },
422+ }
423+ }
425424}
426425```
427426
428427#### CVEC #### {#cvec_format_equiv}
429428
430429```json
431- {
432- "format ": {
430+ "format": {
431+ "subformat ": {
433432 "level": "sparse",
434433 "rank": 1,
435434 "subformat": {
436435 "level": "element",
437436 }
438- },
437+ }
439438}
440439```
441440
442441#### CSR #### {#csr_format_equiv}
443442
444443```json
445- {
446- "format ": {
444+ "format": {
445+ "subformat ": {
447446 "level": "dense",
448447 "rank": 1,
449448 "subformat": {
@@ -453,16 +452,16 @@ The following formats are equivalent
453452 "level": "element",
454453 }
455454 }
456- },
455+ }
457456}
458457```
459458
460459#### CSC #### {#csc_format_equiv}
461460
462461```json
463- {
464- "swizzle ": [1, 0] ,
465- "format ": {
462+ "format": {
463+ "transpose ": [1, 0] ,
464+ "subformat ": {
466465 "level": "dense",
467466 "rank": 1,
468467 "subformat": {
@@ -472,15 +471,15 @@ The following formats are equivalent
472471 "level": "element",
473472 }
474473 }
475- },
474+ }
476475}
477476```
478477
479478#### DCSR #### {#dcsr_format_equiv}
480479
481480```json
482- {
483- "format ": {
481+ "format": {
482+ "subformat ": {
484483 "level": "sparse",
485484 "rank": 1,
486485 "subformat": {
@@ -490,16 +489,16 @@ The following formats are equivalent
490489 "level": "element",
491490 }
492491 }
493- },
492+ }
494493}
495494```
496495
497496#### DCSC #### {#dcsc_format_equiv}
498497
499498```json
500- {
501- "format ": {
502- "swizzle ": [1, 0] ,
499+ "format": {
500+ "transpose ": [1, 0] ,
501+ "subformat ": {
503502 "level": "sparse",
504503 "rank": 1,
505504 "subformat": {
@@ -509,21 +508,21 @@ The following formats are equivalent
509508 "level": "element",
510509 }
511510 }
512- },
511+ }
513512}
514513```
515514
516515#### COOR #### {#coor_format_equiv}
517516
518517```json
519- {
520- "format ": {
518+ "format": {
519+ "subformat ": {
521520 "level": "sparse",
522521 "rank": 2,
523522 "subformat": {
524523 "level": "element",
525524 }
526- },
525+ }
527526}
528527```
529528
@@ -532,15 +531,15 @@ The following formats are equivalent
532531Column-wise Coordinate format
533532
534533```json
535- {
536- "swizzle ": [1, 0] ,
537- "format ": {
534+ "format": {
535+ "transpose ": [1, 0] ,
536+ "subformat ": {
538537 "level": "sparse",
539538 "rank": 2,
540539 "subformat": {
541540 "level": "element",
542541 }
543- },
542+ }
544543}
545544```
546545
@@ -598,27 +597,12 @@ the modified array shall be at position `2i + 1` in the underlying array.
598597The `complex` value modifier may only be used with the types `float32` and
599598`float64`.
600599
601- If the level key is "complex", the `subformat` key must be present. The
602- complex level represents zero or more complex-valued arrays specified by
603- `subformat`. The real and imaginary components of the `p`th array are the subarrays at
604- positions `2p` and `2p+1`.
605-
606- One can also specify that a type is complex by writing the type as
607- `complex[<type>] `. For example, a value array of complex `float64` would have a
608- datatype of `complex[float64] `.
609-
610600### All Values the Same (ISO) ### {#iso_level}
611601
612- When all values of a sparse array are the same identical value, a special level
613- is provided to compress the value array to a single value rather than
614- duplicating the same number unnecessarily.
615-
616- If the level key is "iso", the `subformat` key must be present. All arrays
617- represented by the iso level map to the same subarray at position 0. The subarray
618- is usually a scalar element which is common to all stored indices.
619-
620- One can specify that the value array should be wrapped in an iso level by
621- writing the value type as `iso[<type>] `.
602+ When all values of a sparse array are the same identical value, the type is
603+ written as `iso[<type>] `. This indicates that the array will store only a single
604+ element which is common to all stored indices. All elements in the modified
605+ array shall be stored at position 0 of the underlying array.
622606
623607<div class=example>
624608
0 commit comments