C Library Functions  - ismember (3)

NAME

ismember(3f) - [M_sets] return ismember values in array A

CONTENTS

Synopsis
Description
Options
Returns
Example
Authors
License

SYNOPSIS

ismember(A,B)

DESCRIPTION

Array elements that are members of set array.
  C = ismember(A,B) returns an array containing "logical" 1 (true) where the data in A is found in B. Elsewhere, the array contains "logical" 0 (false).

OPTIONS

A input array
B input array

RETURNS

    C

EXAMPLE

sample program:

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

write(*,g) ’ISMEMBER’, ’Determine which elements of A are also in B.’

A=[5,3,4,2] B=[2,4,4,4,6,8] write(*,g) ’A=’, A write(*,g) ’B=’, B write(*,g) ismember(A,B)

end program demo_ismember

Results:

 > ISMEMBER Determine which elements of A are also in B.
 > A= 5 3 4 2
 > B= 2 4 4 4 6 8
 > 0 0 1 1

AUTHORS

John S. Urban, 2023-07-20

LICENSE

CC0-1.0


Nemo Release 3.1 ismember (3) July 22, 2023
Generated by manServer 1.08 from c75cd3a8-b972-4562-b620-64e77cc64855 using man macros.