Generate and return .true.
if all elements of the input array-like val
are members of the input array-like object Set
, otherwise, return .false.
.
The functionality of this interface is equivalent to the result of the set-theoretic operation \(\ms{val}\subset\ms{Set}\).
- Parameters
-
[in] | val | : The input scalar of
-
type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) or arbitrary length type parameter,
or vector of
-
type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) or arbitrary length type parameter, or
-
type
integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
-
type
logical of kind any supported by the processor (e.g., LK), or
-
type
complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128), or
whose elements memberships in the Set will be checked. |
[in] | Set | : The input object of the same type, kind, and rank as the input val , representing the set with respect to which all elements of val will be checked. |
- Returns
allMember
: The output scalar logical
of default kind LK.
It is .true.
if and only if all elements of the input val
are members of the input Set
.
Possible calling interfaces ⛓
allMember = val .allin. Set
allMember = val(:) .allin. Set(:)
This module contains procedures and generic interfaces for assessing whether particular value(s) or a...
- See also
- operator(.in.)
operator(.allin.)
operator(.anyin.)
operator(.inrange.)
operator(.anyinrange.)
operator(.allinrange.)
operator(.divmul.)
operator(.subadd.)
getMinMax
setMinMax
pm_arraySearch
pm_arrayFind
Example usage ⛓
14 type(display_type) :: disp
18 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%")
19 call disp%show(
"!Check character scalar.")
20 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%")
24 character(:,SKG),
allocatable :: val, Set
25 Set
= "ParaMonte is a Machine Learning Library."
29 call disp%show( val(:), deliml
= SKG_
"""" )
31 call disp%show( Set, deliml
= SKG_
"""" )
38 character(:,SKG),
allocatable :: val, Set
39 Set
= "ParaMonte is a Machine Learning Library."
43 call disp%show( val(:), deliml
= SKG_
"""" )
45 call disp%show( Set, deliml
= SKG_
"""" )
52 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%")
53 call disp%show(
"!Check character array.")
54 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%")
58 character(
9,SKG),
allocatable :: val(:)
59 character(
10,SKG),
allocatable :: Set(:)
60 Set
= [
character(
10,SKG) ::
"ParaMonte",
"is ",
"a ",
"Monte ",
"Carlo ",
"Library. "]
64 call disp%show( val(:), deliml
= SKG_
"""" )
66 call disp%show( Set, deliml
= SKG_
"""" )
73 character(
9,SKG),
allocatable :: val(:)
74 character(
10,SKG),
allocatable :: Set(:)
75 Set
= [
character(
10,SKG) ::
"ParaMonte",
"is ",
"a ",
"Monte ",
"Carlo ",
"Library. "]
76 val
= [
character(
9,SKG) ::
"paramonte",
"ParaMonte",
"Carlo",
"carlo"]
79 call disp%show( val(:), deliml
= SKG_
"""" )
81 call disp%show( Set, deliml
= SKG_
"""" )
88 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
89 call disp%show(
"!Check integer array.")
90 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
94 integer(IKG),
allocatable :: val(:), Set(:)
98 call disp%show(
"Set = [integer(IKG) :: 0, 1, 2, 3, 4]")
99 Set
= [
integer(IKG) ::
0,
1,
2,
3,
4]
106 integer(IKG),
allocatable :: val(:), Set(:)
108 call disp%show(
"val = [integer(IKG) :: -1, 3, 5]")
109 val
= [
integer(IKG) ::
-1,
3,
5]
110 call disp%show(
"Set = [integer(IKG) :: 0, 1, 2, 3, 4]")
111 Set
= [
integer(IKG) ::
0,
1,
2,
3,
4]
118 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
119 call disp%show(
"!Check logical array.")
120 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
124 logical(LKG),
allocatable :: val(:), Set(:)
128 call disp%show(
"Set = [.true., .true., .true., .true.]")
129 Set
= [
.true.,
.true.,
.true.,
.true.]
136 logical(LKG),
allocatable :: val(:), Set(:)
138 call disp%show(
"val = [.false., .true., .false.]")
139 val
= [
.false.,
.true.,
.false.]
140 call disp%show(
"Set = [.true., .true., .true., .true.]")
141 Set
= [
.true.,
.true.,
.true.,
.true.]
148 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
149 call disp%show(
"!Check complex array.")
150 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%")
154 integer(IKG),
allocatable :: val(:), Set(:)
158 call disp%show(
"Set = [complex(CKG) :: (1., 0.), -(1., 0.), (1., -1.)]")
159 Set
= [
complex(CKG) :: (
1.,
0.),
-(
1.,
0.), (
1.,
-1.)]
166 integer(IKG),
allocatable :: val(:), Set(:)
168 call disp%show(
"val = [(1., -1.), (0., -1.)]")
169 val
= [(
1.,
-1.), (
0.,
-1.)]
170 call disp%show(
"Set = [complex(CKG) :: (1., 0.), -(1., 0.), (1., -1.)]")
171 Set
= [
complex(CKG) :: (
1.,
0.),
-(
1.,
0.), (
1.,
-1.)]
178 call disp%show(
"!%%%%%%%%%%%%%%%%%")
179 call disp%show(
"!Check real array.")
180 call disp%show(
"!%%%%%%%%%%%%%%%%%")
184 real(RKG),
allocatable :: val(:), Set(:)
188 call disp%show(
"Set = [real(RKG) :: 0, 1, 2, 3, 4]")
189 Set
= [
real(RKG) ::
0,
1,
2,
3,
4]
196 real(RKG),
allocatable :: val(:), Set(:)
198 call disp%show(
"val = [real(RKG) :: -1, 1, 5]")
199 val
= [
real(RKG) ::
-1,
1,
5]
200 call disp%show(
"Set = [real(RKG) :: 0, 1, 2, 3, 4]")
201 Set
= [
real(RKG) ::
0,
1,
2,
3,
4]
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
10"ParaMonte is a Machine Learning Library."
18"ParaMonte is a Machine Learning Library."
31"ParaMonte ",
"is ",
"a ",
"Monte ",
"Carlo ",
"Library. "
37"paramonte",
"ParaMonte",
"Carlo ",
"carlo "
39"ParaMonte ",
"is ",
"a ",
"Monte ",
"Carlo ",
"Library. "
50Set
= [
integer(IKG) ::
0,
1,
2,
3,
4]
55val
= [
integer(IKG) ::
-1,
3,
5]
56Set
= [
integer(IKG) ::
0,
1,
2,
3,
4]
67Set
= [
.true.,
.true.,
.true.,
.true.]
72val
= [
.false.,
.true.,
.false.]
73Set
= [
.true.,
.true.,
.true.,
.true.]
84Set
= [
complex(CKG) :: (
1.,
0.),
-(
1.,
0.), (
1.,
-1.)]
89val
= [(
1.,
-1.), (
0.,
-1.)]
90Set
= [
complex(CKG) :: (
1.,
0.),
-(
1.,
0.), (
1.,
-1.)]
101Set
= [
real(RKG) ::
0,
1,
2,
3,
4]
106val
= [
real(RKG) ::
-1,
1,
5]
107Set
= [
real(RKG) ::
0,
1,
2,
3,
4]
- Test:
- test_pm_arrayMembership
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Fatemeh Bagheri, Wednesday 1:35 PM, August 11, 2021, Dallas, TX
Definition at line 1700 of file pm_arrayMembership.F90.