ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_complexCompareLex.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
43
44!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
47
48 use pm_kind, only: SK, IK, LK
49 implicit none
50
51 character(*,SK), parameter :: MODULE_NAME = "@pm_complexCompareLex"
52
53!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54
100 interface operator(<)
101
102 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103
104#if CK5_ENABLED
105 pure elemental module function islexless_CK5(val1, val2) result(compares)
106#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
107 !DEC$ ATTRIBUTES DLLEXPORT :: islexless_CK5
108#endif
109 use pm_kind, only: CKG => CK5
110 complex(CKG), intent(in) :: val1, val2
111 logical(LK) :: compares
112 end function
113#endif
114
115#if CK4_ENABLED
116 pure elemental module function islexless_CK4(val1, val2) result(compares)
117#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
118 !DEC$ ATTRIBUTES DLLEXPORT :: islexless_CK4
119#endif
120 use pm_kind, only: CKG => CK4
121 complex(CKG), intent(in) :: val1, val2
122 logical(LK) :: compares
123 end function
124#endif
125
126#if CK3_ENABLED
127 pure elemental module function islexless_CK3(val1, val2) result(compares)
128#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
129 !DEC$ ATTRIBUTES DLLEXPORT :: islexless_CK3
130#endif
131 use pm_kind, only: CKG => CK3
132 complex(CKG), intent(in) :: val1, val2
133 logical(LK) :: compares
134 end function
135#endif
136
137#if CK2_ENABLED
138 pure elemental module function islexless_CK2(val1, val2) result(compares)
139#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
140 !DEC$ ATTRIBUTES DLLEXPORT :: islexless_CK2
141#endif
142 use pm_kind, only: CKG => CK2
143 complex(CKG), intent(in) :: val1, val2
144 logical(LK) :: compares
145 end function
146#endif
147
148#if CK1_ENABLED
149 pure elemental module function islexless_CK1(val1, val2) result(compares)
150#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
151 !DEC$ ATTRIBUTES DLLEXPORT :: islexless_CK1
152#endif
153 use pm_kind, only: CKG => CK1
154 complex(CKG), intent(in) :: val1, val2
155 logical(LK) :: compares
156 end function
157#endif
158
159 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160
161 end interface
162
163!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164
211 interface operator(<=)
212
213 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214
215#if CK5_ENABLED
216 pure elemental module function islexleq_CK5(val1, val2) result(compares)
217#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
218 !DEC$ ATTRIBUTES DLLEXPORT :: islexleq_CK5
219#endif
220 use pm_kind, only: CKG => CK5
221 complex(CKG), intent(in) :: val1, val2
222 logical(LK) :: compares
223 end function
224#endif
225
226#if CK4_ENABLED
227 pure elemental module function islexleq_CK4(val1, val2) result(compares)
228#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
229 !DEC$ ATTRIBUTES DLLEXPORT :: islexleq_CK4
230#endif
231 use pm_kind, only: CKG => CK4
232 complex(CKG), intent(in) :: val1, val2
233 logical(LK) :: compares
234 end function
235#endif
236
237#if CK3_ENABLED
238 pure elemental module function islexleq_CK3(val1, val2) result(compares)
239#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
240 !DEC$ ATTRIBUTES DLLEXPORT :: islexleq_CK3
241#endif
242 use pm_kind, only: CKG => CK3
243 complex(CKG), intent(in) :: val1, val2
244 logical(LK) :: compares
245 end function
246#endif
247
248#if CK2_ENABLED
249 pure elemental module function islexleq_CK2(val1, val2) result(compares)
250#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
251 !DEC$ ATTRIBUTES DLLEXPORT :: islexleq_CK2
252#endif
253 use pm_kind, only: CKG => CK2
254 complex(CKG), intent(in) :: val1, val2
255 logical(LK) :: compares
256 end function
257#endif
258
259#if CK1_ENABLED
260 pure elemental module function islexleq_CK1(val1, val2) result(compares)
261#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
262 !DEC$ ATTRIBUTES DLLEXPORT :: islexleq_CK1
263#endif
264 use pm_kind, only: CKG => CK1
265 complex(CKG), intent(in) :: val1, val2
266 logical(LK) :: compares
267 end function
268#endif
269
270 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271
272 end interface
273
274!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
275!
276! !> \brief
277! !> \anchor pm_complexCompareLex_isanyeq
278! !> Generate and return `.true.` if either components of the input `complex` argument `val1`
279! !> is equal to the corresponding components of the input `complex` argument `val2`.
280! !>
281! !> \param[in] val1 : The input scalar, or array of the same rank and shape as `val2`, of type `complex` of kind \CKALL.
282! !> \param[in] val2 : The input scalar, or array of the same rank and shape as `val1`, of the same type and kind as `val1`.
283! !>
284! !> \return
285! !> `compares` : The output object of type `logical` of default kind \LK, and
286! !> the higher rank of the two input arguments `val1` and `val2`.
287! !>
288! !> \interface
289! !> \code{.F90}
290! !>
291! !> use pm_complexCompareLex, only: operator(==)
292! !> use pm_kind, only: LK
293! !> complex(LK) :: compares
294! !>
295! !> compares = val1 == val2
296! !>
297! !> \endcode
298! !>
299! !> \pure
300! !>
301! !> \elemental
302! !>
303! !> \see
304! !> [operator(<)](@ref pm_complexCompareLex_islexless)<br>
305! !> [operator(<=)](@ref pm_complexCompareLex_islexleq)<br>
306! !> [operator(.anyeq.)](@ref pm_complexCompareLex_islexneq)<br>
307! !> [operator(.lexneq.)](@ref pm_complexCompareLex_islexneq)<br>
308! !> [operator(>=)](@ref pm_complexCompareLex_islexmeq)<br>
309! !> [operator(>)](@ref pm_complexCompareLex_islexmore)<br>
310! !>
311! !> \example
312! !> \include{lineno} example/pm_complexCompareLex/isanyeq/main.F90
313! !> \compilef
314! !> \output
315! !> \include{lineno} example/pm_complexCompareLex/isanyeq/main.out.F90
316! !>
317! !> \test
318! !> [test_pm_complexCompareLex](@ref test_pm_complexCompareLex)
319! !>
320! !> \final
321! !>
322! !> \author
323! !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin<br>
324! interface operator(.anyeq.)
325!
326! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327!
328!#if CK3_ENABLED
329! pure elemental module function isanyeq_CK3(val1, val2) result(compares)
330!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
331! !DEC$ ATTRIBUTES DLLEXPORT :: isanyeq_CK3
332!#endif
333! use pm_kind, only: CKG => CK3
334! complex(CKG), intent(in) :: val1, val2
335! logical(LK) :: compares
336! end function
337!#endif
338!
339!#if CK2_ENABLED
340! pure elemental module function isanyeq_CK2(val1, val2) result(compares)
341!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
342! !DEC$ ATTRIBUTES DLLEXPORT :: isanyeq_CK2
343!#endif
344! use pm_kind, only: CKG => CK2
345! complex(CKG), intent(in) :: val1, val2
346! logical(LK) :: compares
347! end function
348!#endif
349!
350!#if CK1_ENABLED
351! pure elemental module function isanyeq_CK1(val1, val2) result(compares)
352!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
353! !DEC$ ATTRIBUTES DLLEXPORT :: isanyeq_CK1
354!#endif
355! use pm_kind, only: CKG => CK1
356! complex(CKG), intent(in) :: val1, val2
357! logical(LK) :: compares
358! end function
359!#endif
360!
361! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
362!
363! end interface
364!
365!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366!
367! !> \brief
368! !> \anchor pm_complexCompareLex_islexneq
369! !> Generate and return `.true.` if either components of the input `complex` argument `val1`
370! !> are not equal to the corresponding components of the input `complex` argument `val2`.
371! !>
372! !> \param[in] val1 : The input scalar, or array of the same rank and shape as `val2`, of type `complex` of kind \CKALL.
373! !> \param[in] val2 : The input scalar, or array of the same rank and shape as `val1`, of the same type and kind as `val1`.
374! !>
375! !> \return
376! !> `compares` : The output object of type `logical` of default kind \LK, and
377! !> the higher rank of the two input arguments `val1` and `val2`.
378! !>
379! !> \remark
380! !> The intrinsic operator `/=` defined for complex numbers conflicts with the inequality definition in this interface.
381! !> As such, the interface is named `.lexneq.` to avoid the name clash.
382! !>
383! !> \interface
384! !> \code{.F90}
385! !>
386! !> use pm_complexCompareLex, only: operator(.lexneq.)
387! !> use pm_kind, only: LK
388! !> complex(LK) :: compares
389! !>
390! !> compares = val1 .lexneq. val2
391! !>
392! !> \endcode
393! !>
394! !> \pure
395! !>
396! !> \elemental
397! !>
398! !> \see
399! !> [operator(<)](@ref pm_complexCompareLex_islexless)<br>
400! !> [operator(<=)](@ref pm_complexCompareLex_islexleq)<br>
401! !> [operator(.anyeq.)](@ref pm_complexCompareLex_islexneq)<br>
402! !> [operator(.lexneq.)](@ref pm_complexCompareLex_islexneq)<br>
403! !> [operator(>=)](@ref pm_complexCompareLex_islexmeq)<br>
404! !> [operator(>)](@ref pm_complexCompareLex_islexmore)<br>
405! !>
406! !> \example
407! !> \include{lineno} example/pm_complexCompareLex/islexneq/main.F90
408! !> \compilef
409! !> \output
410! !> \include{lineno} example/pm_complexCompareLex/islexneq/main.out.F90
411! !>
412! !> \test
413! !> [test_pm_complexCompareLex](@ref test_pm_complexCompareLex)
414! !>
415! !> \final
416! !>
417! !> \author
418! !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin<br>
419! interface operator(.lexneq.)
420!
421! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
422!
423!#if CK3_ENABLED
424! pure elemental module function islexneq_CK3(val1, val2) result(compares)
425!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
426! !DEC$ ATTRIBUTES DLLEXPORT :: islexneq_CK3
427!#endif
428! use pm_kind, only: CKG => CK3
429! complex(CKG), intent(in) :: val1, val2
430! logical(LK) :: compares
431! end function
432!#endif
433!
434!#if CK2_ENABLED
435! pure elemental module function islexneq_CK2(val1, val2) result(compares)
436!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
437! !DEC$ ATTRIBUTES DLLEXPORT :: islexneq_CK2
438!#endif
439! use pm_kind, only: CKG => CK2
440! complex(CKG), intent(in) :: val1, val2
441! logical(LK) :: compares
442! end function
443!#endif
444!
445!#if CK1_ENABLED
446! pure elemental module function islexneq_CK1(val1, val2) result(compares)
447!#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
448! !DEC$ ATTRIBUTES DLLEXPORT :: islexneq_CK1
449!#endif
450! use pm_kind, only: CKG => CK1
451! complex(CKG), intent(in) :: val1, val2
452! logical(LK) :: compares
453! end function
454!#endif
455!
456! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
457!
458! end interface
459!
460!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461
508 interface operator(>=)
509
510 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511
512#if CK5_ENABLED
513 pure elemental module function islexmeq_CK5(val1, val2) result(compares)
514#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
515 !DEC$ ATTRIBUTES DLLEXPORT :: islexmeq_CK5
516#endif
517 use pm_kind, only: CKG => CK5
518 complex(CKG), intent(in) :: val1, val2
519 logical(LK) :: compares
520 end function
521#endif
522
523#if CK4_ENABLED
524 pure elemental module function islexmeq_CK4(val1, val2) result(compares)
525#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
526 !DEC$ ATTRIBUTES DLLEXPORT :: islexmeq_CK4
527#endif
528 use pm_kind, only: CKG => CK4
529 complex(CKG), intent(in) :: val1, val2
530 logical(LK) :: compares
531 end function
532#endif
533
534#if CK3_ENABLED
535 pure elemental module function islexmeq_CK3(val1, val2) result(compares)
536#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
537 !DEC$ ATTRIBUTES DLLEXPORT :: islexmeq_CK3
538#endif
539 use pm_kind, only: CKG => CK3
540 complex(CKG), intent(in) :: val1, val2
541 logical(LK) :: compares
542 end function
543#endif
544
545#if CK2_ENABLED
546 pure elemental module function islexmeq_CK2(val1, val2) result(compares)
547#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
548 !DEC$ ATTRIBUTES DLLEXPORT :: islexmeq_CK2
549#endif
550 use pm_kind, only: CKG => CK2
551 complex(CKG), intent(in) :: val1, val2
552 logical(LK) :: compares
553 end function
554#endif
555
556#if CK1_ENABLED
557 pure elemental module function islexmeq_CK1(val1, val2) result(compares)
558#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
559 !DEC$ ATTRIBUTES DLLEXPORT :: islexmeq_CK1
560#endif
561 use pm_kind, only: CKG => CK1
562 complex(CKG), intent(in) :: val1, val2
563 logical(LK) :: compares
564 end function
565#endif
566
567 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
568
569 end interface
570
571!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
572
619 interface operator(>)
620
621 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
622
623#if CK5_ENABLED
624 pure elemental module function islexmore_CK5(val1, val2) result(compares)
625#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
626 !DEC$ ATTRIBUTES DLLEXPORT :: islexmore_CK5
627#endif
628 use pm_kind, only: CKG => CK5
629 complex(CKG), intent(in) :: val1, val2
630 logical(LK) :: compares
631 end function
632#endif
633
634#if CK4_ENABLED
635 pure elemental module function islexmore_CK4(val1, val2) result(compares)
636#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
637 !DEC$ ATTRIBUTES DLLEXPORT :: islexmore_CK4
638#endif
639 use pm_kind, only: CKG => CK4
640 complex(CKG), intent(in) :: val1, val2
641 logical(LK) :: compares
642 end function
643#endif
644
645#if CK3_ENABLED
646 pure elemental module function islexmore_CK3(val1, val2) result(compares)
647#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
648 !DEC$ ATTRIBUTES DLLEXPORT :: islexmore_CK3
649#endif
650 use pm_kind, only: CKG => CK3
651 complex(CKG), intent(in) :: val1, val2
652 logical(LK) :: compares
653 end function
654#endif
655
656#if CK2_ENABLED
657 pure elemental module function islexmore_CK2(val1, val2) result(compares)
658#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
659 !DEC$ ATTRIBUTES DLLEXPORT :: islexmore_CK2
660#endif
661 use pm_kind, only: CKG => CK2
662 complex(CKG), intent(in) :: val1, val2
663 logical(LK) :: compares
664 end function
665#endif
666
667#if CK1_ENABLED
668 pure elemental module function islexmore_CK1(val1, val2) result(compares)
669#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
670 !DEC$ ATTRIBUTES DLLEXPORT :: islexmore_CK1
671#endif
672 use pm_kind, only: CKG => CK1
673 complex(CKG), intent(in) :: val1, val2
674 logical(LK) :: compares
675 end function
676#endif
677
678 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
679
680 end interface
681
682!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
683
684end module pm_complexCompareLex ! LCOV_EXCL_LINE
This module contains procedures and generic interfaces for checking if a complex number is lexicograp...
character(*, SK), parameter MODULE_NAME
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter CK1
Definition: pm_kind.F90:464
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CK5
Definition: pm_kind.F90:420
integer, parameter CK4
Definition: pm_kind.F90:431
integer, parameter CK2
Definition: pm_kind.F90:453
integer, parameter CK3
Definition: pm_kind.F90:442
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539