ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_array.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
41
42!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
45
46 use pm_kind, only: SK
47
48 implicit none
49
50 character(*,SK), parameter :: MODULE_NAME = "@pm_array"
51
52!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54
88 type, abstract :: action_type
89 end type
90
91!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92
132 type, extends(action_type) :: nothing_type
133 end type
134
167 type(nothing_type), parameter :: nothing = nothing_type()
168#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
169 !DIR$ ATTRIBUTES DLLEXPORT :: nothing
170#endif
171
172!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173
213 type, extends(action_type) :: reverse_type
214 end type
215
248 type(reverse_type), parameter :: reverse = reverse_type()
249#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
250 !DIR$ ATTRIBUTES DLLEXPORT :: reverse
251#endif
252
253!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254
294 type, extends(action_type) :: inverse_type
295 end type
296
329 type(inverse_type), parameter :: inverse = inverse_type()
330#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
331 !DIR$ ATTRIBUTES DLLEXPORT :: inverse
332#endif
333
334!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
335!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
336
370 type, abstract :: direction_type
371 end type
372
373!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374
414 type, extends(direction_type) :: forward_type
415 end type
416
449 type(forward_type), parameter :: forward = forward_type()
450#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
451 !DIR$ ATTRIBUTES DLLEXPORT :: forward
452#endif
453
454!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
455
496 end type
497
530 type(backward_type), parameter :: backward = backward_type()
531#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
532 !DIR$ ATTRIBUTES DLLEXPORT :: backward
533#endif
534
535!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
536!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537
571 type, abstract :: side_type
572 end type
573
574!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
575
615 type, extends(side_type) :: left_type
616 end type
617
650 type(left_type), parameter :: left = left_type()
651#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
652 !DIR$ ATTRIBUTES DLLEXPORT :: left
653#endif
654
655!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
656
696 type, extends(side_type) :: right_type
697 end type
698
731 type(right_type), parameter :: right = right_type()
732#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
733 !DIR$ ATTRIBUTES DLLEXPORT :: right
734#endif
735
736!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
737
777 type, extends(side_type) :: leftRight_type
778 end type
779
813#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
814 !DIR$ ATTRIBUTES DLLEXPORT :: leftRight
815#endif
816
817!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
818!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
819
839 type, abstract :: border_type
840 end type
841
842!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
843
869 type, extends(border_type) :: adjacent_type
870 end type
871
890 type(adjacent_type), parameter :: adjacent = adjacent_type()
891#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
892 !DIR$ ATTRIBUTES DLLEXPORT :: adjacent
893#endif
894
895!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896
922 type, extends(border_type) :: discrete_type
923 end type
924
943 type(discrete_type), parameter :: discrete = discrete_type()
944#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
945 !DIR$ ATTRIBUTES DLLEXPORT :: discrete
946#endif
947
948!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
949!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
950
974 type, abstract :: order_type
975 end type
976
977!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%
978
1008 type, extends(order_type) :: sorted_type
1009 end type
1010
1033 type(sorted_type), parameter :: sorted = sorted_type()
1034#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1035 !DIR$ ATTRIBUTES DLLEXPORT :: sorted
1036#endif
1037
1038!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1039
1069 type, extends(order_type) :: monotonic_type
1070 end type
1071
1095#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1096 !DIR$ ATTRIBUTES DLLEXPORT :: monotonic
1097#endif
1098
1099!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1100
1130 type, extends(sorted_type) :: ascending_type
1131 end type
1132
1156#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1157 !DIR$ ATTRIBUTES DLLEXPORT :: ascending
1158#endif
1159
1160!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1161
1190 end type
1191
1213#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1214 !DIR$ ATTRIBUTES DLLEXPORT :: descending
1215#endif
1216
1217!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1218!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1219
1243 end type
1244
1261#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1262 !DIR$ ATTRIBUTES DLLEXPORT :: allocatable
1263#endif
1264
1265!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1266!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1267
1268end module pm_array ! LCOV_EXCL_LINE
This module contains abstract and concrete derived types that are required for compile-time resolutio...
Definition: pm_array.F90:44
type(discrete_type), parameter discrete
This is a scalar parameter object of type discrete_type that is exclusively used to signify the discr...
Definition: pm_array.F90:943
type(ascending_type), parameter ascending
This is a scalar parameter object of type ascending_type that is exclusively used to signify the asce...
Definition: pm_array.F90:1155
type(forward_type), parameter forward
This is a scalar parameter object of type forward_type that is exclusively used to request reversal o...
Definition: pm_array.F90:449
type(inverse_type), parameter inverse
This is a scalar parameter object of type inverse_type that is exclusively used to request reversal o...
Definition: pm_array.F90:329
character(*, SK), parameter MODULE_NAME
Definition: pm_array.F90:50
type(left_type), parameter left
This is a scalar parameter object of type left_type that is exclusively used to request the left side...
Definition: pm_array.F90:650
type(reverse_type), parameter reverse
This is a scalar parameter object of type reverse_type that is exclusively used to request reversal o...
Definition: pm_array.F90:248
type(monotonic_type), parameter monotonic
This is a scalar parameter object of type monotonic_type that is exclusively used to signify the mono...
Definition: pm_array.F90:1094
type(leftRight_type), parameter leftRight
This is a scalar parameter object of type leftRight_type that is exclusively used to request the left...
Definition: pm_array.F90:812
type(descending_type), parameter descending
This is a scalar parameter object of type descending_type that is exclusively used to signify the des...
Definition: pm_array.F90:1212
type(nothing_type), parameter nothing
This is a scalar parameter object of type nothing_type that is exclusively used to request no action ...
Definition: pm_array.F90:167
type(adjacent_type), parameter adjacent
This is a scalar parameter object of type adjacent_type that is exclusively used to signify the adjac...
Definition: pm_array.F90:890
type(sorted_type), parameter sorted
This is a scalar parameter object of type sorted_type that is exclusively used to signify the sorted ...
Definition: pm_array.F90:1033
type(right_type), parameter right
This is a scalar parameter object of type right_type that is exclusively used to request the right si...
Definition: pm_array.F90:731
type(allocatable_type), parameter allocatable
This is a scalar parameter object of type allocatable_type that is exclusively used to signify that a...
Definition: pm_array.F90:1260
type(backward_type), parameter backward
This is a scalar parameter object of type backward_type that is exclusively used to request reversal ...
Definition: pm_array.F90:530
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
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
This is an abstract derived type for constructing concrete derived types to distinguish various proce...
Definition: pm_array.F90:88
This is a concrete derived type whose instances are exclusively used to signify the adjacent sequence...
Definition: pm_array.F90:869
This is a concrete derived type whose instances are exclusively used to signify that an array of arbi...
Definition: pm_array.F90:1242
This is a concrete derived type whose instances are exclusively used to signify the ascending sequenc...
Definition: pm_array.F90:1130
This is a concrete derived type whose instances are exclusively used to request reversal of a given a...
Definition: pm_array.F90:495
This is an abstract derived type for constructing concrete derived types to distinguish various proce...
Definition: pm_array.F90:839
This is a concrete derived type whose instances are exclusively used to signify the descending sequen...
Definition: pm_array.F90:1189
This is an abstract derived type for constructing concrete derived types to distinguish various proce...
Definition: pm_array.F90:370
This is a concrete derived type whose instances are exclusively used to signify the discrete sequence...
Definition: pm_array.F90:922
This is a concrete derived type whose instances are exclusively used to request reversal of a given a...
Definition: pm_array.F90:414
This is a concrete derived type whose instances are exclusively used to request reversal of a given a...
Definition: pm_array.F90:294
This is a concrete derived type whose instances are exclusively used to request left-and-right sides ...
Definition: pm_array.F90:777
This is a concrete derived type whose instances are exclusively used to request left side of a given ...
Definition: pm_array.F90:615
This is a concrete derived type whose instances are exclusively used to signify the monotonic sequenc...
Definition: pm_array.F90:1069
This is a concrete derived type whose instances are exclusively used to request no action on a given ...
Definition: pm_array.F90:132
This is an abstract derived type for constructing concrete derived types to distinguish various proce...
Definition: pm_array.F90:974
This is a concrete derived type whose instances are exclusively used to request reversal of a given a...
Definition: pm_array.F90:213
This is a concrete derived type whose instances are exclusively used to request the right side of a g...
Definition: pm_array.F90:696
This is an abstract derived type for constructing concrete derived types to distinguish various proce...
Definition: pm_array.F90:571
This is a concrete derived type whose instances are exclusively used to signify the sorted sequence o...
Definition: pm_array.F90:1008