C Library Functions  - setxor (3)

NAME

setxor(3f) - [M_sets] Find values of A and B not in both arrays

CONTENTS

Synopsis
Description
Options
Examples
Authors
License

SYNOPSIS

setxor(A,B, setOrder)

DESCRIPTION

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.
Another way of defining the result is that setxor(3f) returns the data that occurs in A or B, but not both.

OPTIONS

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.

EXAMPLES

sample program:

   program demo_setxor
   use M_sets, only: setxor
   character(len=*),parameter :: g=’(*(g0,1x))’
   integer, allocatable       :: A(:)
   integer, allocatable       :: B(:)

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

Results:

 > 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

AUTHORS

John S. Urban, 2023-07-20

LICENSE

CC0-1.0


Nemo Release 3.1 setxor (3) February 23, 2025
Generated by manServer 1.08 from 6de6eabe-a3e7-4312-a09b-056f2e5049d9 using man macros.