IsIn
This routine returns a vector of bool if an integer set is a subset of another integer set.
This function returns a vector of booleans. If a(i) is inside the b, then ans(i) is true, otherwise false.
Calling example:
abool = [1,2,3] .in. [1,3,4,5,2]
Interface
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE FUNCTION IsIn(a, b) RESULT(Ans)
INTEGER(INT8| Int16 | Int32 | Int64), INTENT(IN) :: a(:)
INTEGER(INT8| Int16 | Int32 | Int64), INTENT(IN) :: b(:)
LOGICAL(LGT) :: ans(size(a))
END FUNCTION IsIn
This example shows the usage of isIn
method which is defined in IntegerUtility
module.
program main
use easifembase
implicit none
call Display( [9, 10, 11, 12] .isIn. [12,9], "test(1)=")
call Display([12,9] .isIn. [9, 10, 11, 12], "test(2)=")
end program main
Results
test(1)=
--------
T
F
F
T
test(2)=
--------
T
T