setxor(3f) - [M_sets] Find values of A and B not in both arrays
Synopsis
Description
Options
Examples
Authors
License
setxor(A,B, setOrder)
Another way of defining the result is that setxor(3f) returns the data that occurs in A or B, but not both.
setxfor(3f) returns the exclusive OR of two arrays. That is, it returns the data of A and B that are not in their intersection (the symmetric difference), with no repetitions.
A input array B input array setOrder May be "sort" or "stable". If "stable" the values are returned in the order discovered. The default is "sorted", which returns the data in ascending order.
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) | February 23, 2025 |