UNIQN Function

Finds the unique rows in a matrix.

Usage

b = UNIQN( a ) 

Input Parameters

a—An m-by-n array of m n-tuples.

Returned Value

b—A p-by-n array of the p unique rows, lexicographically sorted.

Keywords

Sorted—If set, UNIQN treats the input as if it is already in lexicographical order, otherwise the input is sorted before the unique rows are retrieved. The default is not set (unsorted). This keyword is ignored if the input data is of type STRING.

Isort—(output) Array of indices defining the sorted version of the input, i.e. a(Isort,*). This keyword is ignored if the Sorted keyword is set or if the input data is of type STRING.

Manyequal—If set, an older algorithm is used which is sometimes faster if the input array has many equal rows, e.g., less than 10% unique. This algorithm is always used on string data.

Example

a = [[0, 1, 1, 0, 1], [0, 1, 1, 1, 0]]
PM, a
; PV-WAVE prints: 
; 0       0 
; 1       1 
; 1       1 
; 0       1 
; 1       0 
PRINT, 'Unique rows:'
PM, UNIQN(a)
; PV-WAVE prints: 
; Unique rows:
; 0       0 
; 0       1 
; 1       0 
; 1       1 

See Also

SORTN, UNIQUE