The example beneath is designed to explain how release works.
| Input parameter: | Input value(s): | Description etc.: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode | 0 | Always set this to '0' on first call, leave untouched thereafter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| leading | 1 | No. of leading elements in 'idata()' that the users does not wish to compress | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| length | 29 | Dimension of (uncompressed) 'idata()'; left unchanged by release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idata |
2*: 'leading' - 32768 3*: 'trailing' - 32768 4*: int(# compressed entries/65536) - 32768 5*: mod(# compressed entries, 65536) - 32768 6*: compression algorithm no. 7 - 23: compressed array 24: trailing entry | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxsize | 27 |
Dimension of the work array 'iwork()'; in the 2D case, this must be set >= nx*ny, etc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nfactors | 263 | Dimension of 'factors()'; should be set >= 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| factors | ... |
Factors used in the construction of the original set of values; will be set on first call | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (1) | -32768 | -> single value specifier, read next value which is uncompressed |
| (3) | -3631 | -> under algorithm no. 4, negative values are two differences
compressed as one: d1 = mod(3631-1, 181) = 10 d2 = (3631-1 - d1)/181 = 20 |
| (4) | 308 | -> bitsum = 308 + 32768 = 33076 |
| bitsum >= 2**15 | -> | sign(16) = -1 bitsum = bitsum - 2**15 = 308 |
| bitsum < 2**14 | -> | sign(15) = 1 |
| bitsum < 2**13 | -> | sign(14) = 1 |
| bitsum < 2**12 | -> | sign(13) = 1 |
| bitsum < 2**11 | -> | sign(12) = 1 |
| bitsum < 2**10 | -> | sign(11) = 1 |
| bitsum < 2**9 | -> | sign(10) = 1 |
| bitsum >= 2**8 | -> | sign(9) = -1 bitsum = bitsum - 2**8 = 52 |
| bitsum < 2**7 | -> | sign(8) = 1 |
| bitsum < 2**6 | -> | sign(7) = 1 |
| bitsum >= 2**5 | -> | sign(6) = -1 bitsum = bitsum - 2**5 = 20 |
| bitsum >= 2**4 | -> | sign(5) = -1 bitsum = bitsum - 2**4 = 4 |
| bitsum < 2**3 | -> | sign(4) = 1 |
| bitsum >= 2**2 | -> | sign(3) = -1 bitsum = bitsum - 2**2 = 0 |
| bitsum < 2**1 | -> | sign(2) = 1 |
| bitsum < 2**0 | -> | sign(1) = 1 |
| (5) | -1123 | -> negative values are two differences compressed as one: d1 = mod(1123-1, 181) = 36 d2 = (1123-1 - d1)/181 = 6 |
| (6) | -3261 | -> negative values are two differences compressed as one: d1 = mod(3261-1, 181) = 2 d2 = (3261-1 - d1)/181 = 18 |
| (7) | -16411 | -> negative values are two differences compressed as one: d1 = mod(16411-1, 181) = 120 d2 = (16411-1 - d1)/181 = 90 |
| (8) | -32767 | -> undefined values specifier; next value corresponds to # consequtive undefined values |
| (9) | 32762 | -> # undefined values = 32768 - 32762 = 6 |
| (10) | -32768 | -> single value specifier, read next value which is uncompressed |
| (12) | -10915 | -> negative values are two differences compressed as one: d1 = mod(10915-1, 181) = 54 d2 = (10915-1 - d1)/181 = 60 |
| (13) | -31852 | -> bitsum = -31852 + 32768 = 916 |
| bitsum < 2**15 | -> | sign(16) = 1 |
| bitsum < 2**14 | -> | sign(15) = 1 |
| bitsum < 2**13 | -> | sign(14) = 1 |
| bitsum < 2**12 | -> | sign(13) = 1 |
| bitsum < 2**11 | -> | sign(12) = 1 |
| bitsum < 2**10 | -> | sign(11) = 1 |
| bitsum >= 2**9 | -> | sign(10) = -1 bitsum = bitsum - 2**9 = 404 |
| bitsum >= 2**8 | -> | sign(9) = -1 bitsum = bitsum - 2**8 = 148 |
| bitsum >= 2**7 | -> | sign(8) = -1 bitsum = bitsum - 2**7 = 20 |
| bitsum < 2**6 | -> | sign(7) = 1 |
| bitsum < 2**5 | -> | sign(6) = 1 |
| bitsum >= 2**4 | -> | sign(5) = -1 bitsum = bitsum - 2**4 = 4 |
| bitsum < 2**3 | -> | sign(4) = 1 |
| bitsum >= 2**2 | -> | sign(3) = -1 bitsum = bitsum - 2**2 = 0 |
| bitsum < 2**1 | -> | sign(2) = 1 |
| bitsum < 2**0 | -> | sign(1) = 1 |
| (14) | -1851 | -> negative values are two differences compressed as one: d1 = mod(1851-1, 181) = 40 d2 = (1851-1 - d1)/181 = 10 |
| (15) | -5531 | -> negative values are two differences compressed as one: d1 = mod(5531-1, 181) = 100 d2 = (5531-1 - d1)/181 = 30 |
| (16) | 20820 | -> nonnegative values are three differences compressed as one: d1 = mod(20820, 32) = 20 d2 = mod( [20820 - d1] / 32, 32) = 10 d3 = (20820 - 32*d2 - d1) / (32*32) = 20 |
| (17) | -16371 | -> negative values are two differences compressed as one: d1 = mod(16371-1, 181) = 80 d2 = (16371-1 - d1)/181 = 90 |
| Output parameter: | Output value(s): | Description etc.: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode | 1 | see explanation above (item 16) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ldat | 29 | no. of elements in the original (decompessed) 'idata()', including leading and trailing elements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trailing | 1 | no. of trailing elements in 'idata()' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idata |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| factors |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||