| | 74 | === Segment descriptor representation === |
| | 75 | |
| | 76 | Instead, of repeating the start indices in a segment descriptor, we alternatively might want to represent a segmented array with repeated segments by distinguishing its ''physical'' from its ''logical'' (or ''virtual'') representation. Specifically, instead of representing `[:[:1, 2, 3:], [:1, 2, 3:], [:1, 2, 3:]:]` as |
| | 77 | {{{ |
| | 78 | start: [:0, 0, 0:] |
| | 79 | len: [:3, 3, 3:] |
| | 80 | data: [:1, 2, 3:]) |
| | 81 | }}} |
| | 82 | we might instead represent it as |
| | 83 | {{{ |
| | 84 | vsegs: [:0, 0, 0:] |
| | 85 | pstart: [:0:] |
| | 86 | plen: [ 3:] |
| | 87 | data: [:1, 2, 3:]) |
| | 88 | }}} |
| | 89 | where `pstart`, `plen`, and `data` represent the underlying segmented array (with non-overlapping segments) and `vsegs` specifies the logical segments of the array, where physical segments may occur not at all, once, or multiple times. In this example, the only physical segment is repeated three times. |
| | 90 | |
| | 91 | Our second example, `[:[:1, 2:], [:1, 2:], [:3:], [:3:], [:3:]:]`, which we previously represented as |
| | 92 | {{{ |
| | 93 | start: [:0, 0, 2, 2, 2:] |
| | 94 | len: [:2, 2, 1, 1, 1:] |
| | 95 | data: [:1, 2, 3:]) |
| | 96 | }}} |
| | 97 | will now be |
| | 98 | {{{ |
| | 99 | start: [:0, 0, 1, 1, 1:] |
| | 100 | len: [:2, 1:] |
| | 101 | data: [:1, 2, 3:]) |
| | 102 | }}} |
| | 103 | |