setxor(3f) - [M_sets] return setxor values in array A
Synopsis
Description
Options
Example
Authors
License
setxor(A,B, setOrder)
Set exclusive OR of two arrays. C = setxor(A,B) returns the data of A and B that are not in their intersection (the symmetric difference), with no repetitions. That is, setxor(3f) returns the data that occurs in A or B, but not both. C is in sorted order.
A input array B input array setOrder May be "sort" or "stable"
sample program:
program demo_setxor use M_sets, only: setxor character(len=*),parameter :: g=(*(g0,1x)) integer, allocatable :: A(:) integer, allocatable :: B(:)Results:write(*,g) SETXOR,Find values of A and B not in their intersection. A = [5,1,3,3,3] B = [4,1,2] write(*,g) A=, A write(*,g) A=, B write(*,g) setxor(A,B) write(*,g) setxor(A,B,stable)
end program demo_setxor
> SETXOR Find values of A and B not in their intersection. > A= 5 1 3 3 3 > A= 4 1 2 > 2 3 4 5 > 5 3 4 2
John S. Urban, 2023-07-20
CC0-1.0
Nemo Release 3.1 | setxor (3) | July 22, 2023 |