Line data Source code
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 :
17 : !> \brief
18 : !> This file contains procedure implementations of [pm_knn](@ref pm_knn).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \AmirShahmoradi, Wednesday 5:43 PM, December 25, 2013, Institute for Fusion Studies, The University of Texas at Austin
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : submodule (pm_knn) routines
28 :
29 : #if CHECK_ENABLED
30 : use pm_err, only: getFine
31 : use pm_val2str, only: getStr
32 : use pm_err, only: setAsserted
33 : #define DO_CONCURRENT(I,IBEG,IEND) do I = IBEG, IEND
34 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) \
35 : call setAsserted(ASSERTION,getFine(__FILE__,LINE)//MODULE_NAME//MSG);
36 : #else
37 : #define DO_CONCURRENT(I,IBEG,IEND) do concurrent(I = IBEG : IEND)
38 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) continue;
39 : #endif
40 :
41 : use pm_arraySort, only: setSorted
42 : use pm_arraySelect, only: setSelected
43 : implicit none
44 :
45 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 :
47 : contains
48 :
49 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 :
51 : #define setKnnSorted_ENABLED 1
52 :
53 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 :
57 : #define Val_ENABLED 1
58 :
59 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 :
61 : #define RK_ENABLED 1
62 :
63 : #if RK5_ENABLED
64 : module procedure setKnnSortedVal_RK5
65 : use pm_kind, only: TKC => RK5
66 : #include "pm_knn@routines.inc.F90"
67 : end procedure
68 : #endif
69 :
70 : #if RK4_ENABLED
71 0 : module procedure setKnnSortedVal_RK4
72 : use pm_kind, only: TKC => RK4
73 : #include "pm_knn@routines.inc.F90"
74 0 : end procedure
75 : #endif
76 :
77 : #if RK3_ENABLED
78 0 : module procedure setKnnSortedVal_RK3
79 : use pm_kind, only: TKC => RK3
80 : #include "pm_knn@routines.inc.F90"
81 0 : end procedure
82 : #endif
83 :
84 : #if RK2_ENABLED
85 0 : module procedure setKnnSortedVal_RK2
86 : use pm_kind, only: TKC => RK2
87 : #include "pm_knn@routines.inc.F90"
88 0 : end procedure
89 : #endif
90 :
91 : #if RK1_ENABLED
92 0 : module procedure setKnnSortedVal_RK1
93 : use pm_kind, only: TKC => RK1
94 : #include "pm_knn@routines.inc.F90"
95 0 : end procedure
96 : #endif
97 :
98 : #undef RK_ENABLED
99 :
100 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 :
102 : #undef Val_ENABLED
103 :
104 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 :
108 : #define Kth_ENABLED 1
109 :
110 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 :
112 : #define RK_ENABLED 1
113 :
114 : #if RK5_ENABLED
115 : module procedure setKnnSortedKth_RK5
116 : use pm_kind, only: TKC => RK5
117 : #include "pm_knn@routines.inc.F90"
118 : end procedure
119 : #endif
120 :
121 : #if RK4_ENABLED
122 0 : module procedure setKnnSortedKth_RK4
123 : use pm_kind, only: TKC => RK4
124 : #include "pm_knn@routines.inc.F90"
125 0 : end procedure
126 : #endif
127 :
128 : #if RK3_ENABLED
129 0 : module procedure setKnnSortedKth_RK3
130 : use pm_kind, only: TKC => RK3
131 : #include "pm_knn@routines.inc.F90"
132 0 : end procedure
133 : #endif
134 :
135 : #if RK2_ENABLED
136 0 : module procedure setKnnSortedKth_RK2
137 : use pm_kind, only: TKC => RK2
138 : #include "pm_knn@routines.inc.F90"
139 0 : end procedure
140 : #endif
141 :
142 : #if RK1_ENABLED
143 15 : module procedure setKnnSortedKth_RK1
144 : use pm_kind, only: TKC => RK1
145 : #include "pm_knn@routines.inc.F90"
146 15 : end procedure
147 : #endif
148 :
149 : #undef RK_ENABLED
150 :
151 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 :
153 : #undef Kth_ENABLED
154 :
155 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 :
159 : #define Ind_ENABLED 1
160 :
161 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162 :
163 : #define RK_ENABLED 1
164 :
165 : #if RK5_ENABLED
166 : module procedure setKnnSortedInd_RK5
167 : use pm_kind, only: TKC => RK5
168 : #include "pm_knn@routines.inc.F90"
169 : end procedure
170 : #endif
171 :
172 : #if RK4_ENABLED
173 0 : module procedure setKnnSortedInd_RK4
174 : use pm_kind, only: TKC => RK4
175 : #include "pm_knn@routines.inc.F90"
176 0 : end procedure
177 : #endif
178 :
179 : #if RK3_ENABLED
180 0 : module procedure setKnnSortedInd_RK3
181 : use pm_kind, only: TKC => RK3
182 : #include "pm_knn@routines.inc.F90"
183 0 : end procedure
184 : #endif
185 :
186 : #if RK2_ENABLED
187 0 : module procedure setKnnSortedInd_RK2
188 : use pm_kind, only: TKC => RK2
189 : #include "pm_knn@routines.inc.F90"
190 0 : end procedure
191 : #endif
192 :
193 : #if RK1_ENABLED
194 10 : module procedure setKnnSortedInd_RK1
195 : use pm_kind, only: TKC => RK1
196 : #include "pm_knn@routines.inc.F90"
197 10 : end procedure
198 : #endif
199 :
200 : #undef RK_ENABLED
201 :
202 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203 :
204 : #undef Ind_ENABLED
205 :
206 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209 :
210 : #undef setKnnSorted_ENABLED
211 :
212 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213 :
214 : #undef CHECK_ASSERTION
215 : #undef DO_CONCURRENT
216 :
217 : end submodule routines
|