union(3f) - [M_sets] return union values in array A
Synopsis
Description
Options
Example
Authors
License
union(A,B, setOrder)
Set union of two arrays. C = union(A,B) returns the combined data from A and B with no repetitions. C is in sorted order.
A input array B input array setOrder May be "sort" or "stable"
sample program:
program demo_union use M_sets, only: union character(len=*),parameter :: g=(*(g0,1x)) integer, allocatable :: A(:) integer, allocatable :: B(:) Results:write(*,g) UNION, Find the union of vectors A and B. A=[5, 7, 1] B=[3, 1, 1] write(*,g) A=, A write(*,g) B=, B write(*,g) union(A,B)
A=[5, 5, 3] B=[1, 2, 5] write(*,g) A=, A write(*,g) B=, B write(*,g) union(A, B, sorted) write(*,g) union(A, B, stable)
end program demo_union
> UNION Find the union of vectors A and B. > A= 5 7 1 > B= 3 1 1 > 1 3 5 7 > A= 5 5 3 > B= 1 2 5 > 1 2 3 5 > 5 3 1 2
John S. Urban, 2023-07-20
CC0-1.0
Nemo Release 3.1 | union (3) | July 22, 2023 |