User Tools

Site Tools


jvs:cigal:manual:chapter3:compress

CIGAL Reference Manual, Chapter 3 (Functions): COMPRESS

COMPRESS -- Compress a data variable by removing empty values

usage: vdst = compress(vsrc,flag,idxflag,ovalue)

COMPRESS copies the input variable (VSRC) to the output variable (VDST), omitting empty or unwanted values. Empty values are those containing the “missing value” code (-0) (see NUMBERS(1)). Unwanted values are those that satisfy the FLAG condition:

     FLAG   Meaning
      -1    Omit only empty (missing) values (Default FLAG)
      -2    Omit duplicate values (i.e., the same as the previous)
     >=0    Omit values equal to the OVALUE argument (default OVALUE is FLAG)

If IDXFLAG is non-zero, then the index of each accepted value is copied to the VDST output, otherwise the accepted values themselves are copied.

The length of the output variable usually is the number of accepted values in the input variable. However, if the target variable has a fixed size, then the input data are compressed and stored in contiguous memory, followed by the amount of space that was occupied by the omitted values filled with zeros.

See Also:
DECLARE(2), NUMBERS(1), RELEASE(2)

CIGAL Home, CIGAL Manual, Functions List, Manual Help

jvs/cigal/manual/chapter3/compress.txt · Last modified: 2023/02/23 18:43 (external edit)