unique(3f) - [M_sets] return unique values in array A
Synopsis
Description
Options
Returns
Example
Authors
License
unique(A,setOrder)
Return unique values in array. C = unique(A) returns the same data as in A, but with no repetitions. C is in sorted order by defaul.t
A input array to extract unique values from setOrder May be "sort" or "stable"
sample program:
program demo_unique use M_sets, only: unique character(len=*),parameter :: g=(*(g0,1x)) integer, allocatable :: A(:)Results:write(*,g) UNIQUE,Find the unique elements of vector A. A = [10, -10, 0, 1, 2, 3, 3, 2, 1, -10] write(*,g) A=, A write(*,g) unique(A) write(*,g) unique(A, setOrder=stable)
end program demo_unique
> UNIQUE Find the unique elements of vector A. > A= 10 -10 0 1 2 3 3 2 1 -10 > -10 0 1 2 3 10 > 10 -10 0 1 2 3
John S. Urban, 2023-07-20
CC0-1.0
Nemo Release 3.1 | unique (3) | July 22, 2023 |