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 module contains procedures and generic interfaces for computing the Euclidean norm of a single point (with respect to origin or a given reference)
19 : !> or the pairwise Euclidean distances (squared) of a collection of points with respect to another set of reference points,
20 : !> optionally **without undue overflow or underflow**.
21 : !>
22 : !> \details
23 : !> In mathematics, a **norm** is a function from a real or complex vector space to
24 : !> the non-negative real numbers that behaves in certain ways like the distance from the origin.<br>
25 : !> It commutes with scaling, obeys a form of the triangle inequality, and is zero only at the origin.<br>
26 : !> In particular, the **Euclidean distance** of a vector from the origin is a norm, called the **Euclidean norm**, or **2-norm**.<br>
27 : !> It is commonly defined as the square root of the inner product of a vector with itself.<br>
28 : !>
29 : !> <b>Usage Directions</b><br>
30 : !> <ol>
31 : !> <li> Use [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid) functional generic interface
32 : !> to compute distance of a (set of) point(s) from the origin or a (set of) reference(s), optionally without undue overflow/underflow.<br>
33 : !> <li> Use [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) functional generic interface or
34 : !> the equivalent faster [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) procedural generic
35 : !> interface to compute pairwise (squared) Euclidean distances (i.e., the distance matrix) of a set of points
36 : !> (with or without undue overflow/underflow).<br>
37 : !> </ol>
38 : !>
39 : !> \see
40 : !> [pm_distanceMahal](@ref pm_distanceMahal)<br>
41 : !> [pm_distanceHellinger](@ref pm_distanceHellinger)<br>
42 : !> [pm_distanceManhattan](@ref pm_distanceManhattan)<br>
43 : !> [pm_distanceMinkowski](@ref pm_distanceMinkowski)<br>
44 : !>
45 : !> \devnote
46 : !> While it is possible to merge the generic interfaces for computing the Euclidean, Minkowski, Manhattan,
47 : !> and other distances into a single module, the decision was made not to do so, as each of these metrics require
48 : !> certain parameters that are distinct from other methods.<br>
49 : !> In such a case, there is no point in merging disparate procedures under a single generic interface name.<br>
50 : !>
51 : !> \test
52 : !> [test_pm_distanceEuclid](@ref test_pm_distanceEuclid)<br>
53 : !>
54 : !> \todo
55 : !> \phigh
56 : !> The connection between the different packing schemes of the distance matrix and
57 : !> the packing methods in [pm_matrixPack](@ref pm_matrixPack) must be further clarified.<br>
58 : !>
59 : !> \todo
60 : !> \pmed
61 : !> A comparison and benchmark with faster less numerically-stable computational methods for pairwise distances might be informative here.<br>
62 : !> See also a relevant discussion in [stackexchange](https://scicomp.stackexchange.com/questions/30360/fast-and-numerically-stable-pairwise-distance-algorithms).<br>
63 : !>
64 : !> \finmain
65 : !>
66 : !> \author
67 : !> \AmirShahmoradi, Oct 16, 2022, 2:38 AM, Dallas, TX
68 :
69 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 :
71 : module pm_distanceEuclid
72 :
73 : use pm_kind, only: SK, IK
74 : use pm_array, only: nothing, nothing_type
75 : use pm_matrixPack, only: lfpack, lfpack_type
76 : use pm_matrixPack, only: rdpack, rdpack_type
77 : use pm_matrixSubset, only: uppLow, uppLow_type
78 : use pm_matrixSubset, only: uppLowDia, uppLowDia_type
79 :
80 : implicit none
81 :
82 : character(*, SK), parameter :: MODULE_NAME = "@pm_distanceEuclid"
83 :
84 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 :
86 : !> \brief
87 : !> This is a concrete derived type whose instances are exclusively used to
88 : !> request safe method of computing Euclidean distances (without undue overflow or underflow).<br>
89 : !>
90 : !> \details
91 : !> Objects instantiated from this derived type are exclusively used to differentiate the procedures within
92 : !> the generic interfaces of module [pm_distanceEuclid](@ref pm_distanceEuclid) generic interfaces.<br>
93 : !> As such, this concrete derived type does not contain any attributes.<br>
94 : !>
95 : !> \note
96 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
97 : !> Instead, the end users can use the sole object parameter instance of this derived type [euclid](@ref pm_distanceEuclid::euclid)
98 : !> to request a robust method of computing the Euclidean distances when calling [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)
99 : !> and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
100 : !>
101 : !> \see
102 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
103 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
104 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
105 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
106 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
107 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
108 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
109 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
110 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
111 : !>
112 : !> \finmain{euclid_type}
113 : !>
114 : !> \author
115 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
116 : type :: euclid_type
117 : end type
118 :
119 : !> \brief
120 : !> This is a scalar `parameter` object of type [euclid_type](@ref pm_distanceEuclid::euclid_type) that is
121 : !> exclusively used to request safe method of computing Euclidean distances (without undue overflow or underflow).<br>
122 : !>
123 : !> \details
124 : !> This scalar `parameter` object is exclusively used to differentiate the procedures within the
125 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
126 : !> See [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) for example usage.<br>
127 : !>
128 : !> \see
129 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
130 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
131 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
132 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
133 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
134 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
135 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
136 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
137 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
138 : !>
139 : !> \finmain{euclid}
140 : !>
141 : !> \author
142 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
143 : type(euclid_type), parameter :: euclid = euclid_type()
144 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
145 : !DIR$ ATTRIBUTES DLLEXPORT :: euclid
146 : #endif
147 :
148 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 :
150 : !> \brief
151 : !> This is a concrete derived type whose instances are exclusively used to
152 : !> request unsafe method of computing Euclidean distances (with the possibility of undue overflow or underflow).<br>
153 : !>
154 : !> \details
155 : !> Objects instantiated from this derived type are exclusively used to differentiate the procedures within the
156 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
157 : !> As such, this concrete derived type does not contain any attributes.<br>
158 : !>
159 : !> \note
160 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
161 : !> Instead, the end users can use the sole object parameter instance of this derived type [euclidu](@ref pm_distanceEuclid::euclidu)
162 : !> to request a non-robust method of computing the Euclidean distances when calling [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)
163 : !> and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
164 : !>
165 : !> \see
166 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
167 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
168 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
169 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
170 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
171 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
172 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
173 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
174 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
175 : !>
176 : !> \finmain{euclidu_type}
177 : !>
178 : !> \author
179 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
180 : type :: euclidu_type
181 : end type
182 :
183 : !> \brief
184 : !> This is a scalar `parameter` object of type [euclidu_type](@ref pm_distanceEuclid::euclidu_type)that is
185 : !> exclusively used to request unsafe method of computing Euclidean distances (with the possibility of undue overflow or underflow).<br>
186 : !>
187 : !> \details
188 : !> This scalar `parameter` object is exclusively used to differentiate the procedures within the
189 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
190 : !> See [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) for example usage.<br>
191 : !>
192 : !> \see
193 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
194 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
195 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
196 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
197 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
198 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
199 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
200 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
201 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
202 : !>
203 : !> \finmain{euclidu}
204 : !>
205 : !> \author
206 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
207 : type(euclidu_type), parameter :: euclidu = euclidu_type()
208 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
209 : !DIR$ ATTRIBUTES DLLEXPORT :: euclidu
210 : #endif
211 :
212 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213 :
214 : !> \brief
215 : !> This is a concrete derived type whose instances are exclusively used to
216 : !> request computing Euclidean squared-distances (with the possible risk of overflow or underflow).<br>
217 : !>
218 : !> \details
219 : !> Objects instantiated from this derived type are exclusively used to differentiate the procedures within the
220 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
221 : !> As such, this concrete derived type does not contain any attributes.<br>
222 : !>
223 : !> \note
224 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
225 : !> Instead, the end users can use the sole object parameter instance of this derived type [euclidsq](@ref pm_distanceEuclid::euclidsq)
226 : !> to request computing the Euclidean squared-distances when calling [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)
227 : !> and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
228 : !>
229 : !> \see
230 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
231 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
232 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
233 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
234 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
235 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
236 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
237 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
238 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
239 : !>
240 : !> \finmain{euclidsq_type}
241 : !>
242 : !> \author
243 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
244 : type :: euclidsq_type
245 : end type
246 :
247 : !> \brief
248 : !> This is a scalar `parameter` object of type [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)that is
249 : !> exclusively used to request computing Euclidean <b>squared</b>-distances (without undue overflow or underflow).<br>
250 : !>
251 : !> \details
252 : !> This scalar `parameter` object is exclusively used to differentiate the procedures within the
253 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) generic interfaces.<br>
254 : !> See [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid) and [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid) for example usage.<br>
255 : !>
256 : !> \see
257 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
258 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
259 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
260 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
261 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
262 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
263 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
264 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
265 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
266 : !>
267 : !> \finmain{euclidsq}
268 : !>
269 : !> \author
270 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
271 : type(euclidsq_type), parameter :: euclidsq = euclidsq_type()
272 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
273 : !DIR$ ATTRIBUTES DLLEXPORT :: euclidsq
274 : #endif
275 :
276 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277 :
278 : !> \brief
279 : !> Generate and return the (squared) Euclidean distance of a (set of) point(s) in `ndim`-dimensions from a reference point (possibly origin),
280 : !> optionally robustly without underflow or overflow.<br>
281 : !>
282 : !> \param[in] x : The input scalar (or array of the same rank as other array-like arguments) of the same type and kind as the output `distance`
283 : !> containing the `x` component of a 3D vector whose Euclidean norm is to be computed.<br>
284 : !> (**optional**. It must be present **if and only if** the input arguments `point` and `ref` are missing and `y` and `z` are present.)
285 : !> \param[in] y : The input scalar (or array of the same rank as other array-like arguments), of the same type and kind as `x`,
286 : !> containing the `y` component of a 2D or 3D vector whose Euclidean norm is to be computed.<br>
287 : !> (**optional**. It must be present **if and only if** the input arguments `point` and `ref` are missing and `x` an `z` are present.)
288 : !> \param[in] z : The input scalar (or array of the same rank as other array-like arguments), of the same type and kind as `x`,
289 : !> containing the `z` component of a 3D vector whose Euclidean norm is to be computed.<br>
290 : !> (**optional**. It must be present **if and only if** the input arguments `point` and `ref` are missing and `x` and `y` are present.)
291 : !> \param[in] point : The input `contiguous` vector of shape `(1:ndim)` or matrix of shape `(1:ndim, 1:npnt)` of the same type and kind as the output `distance`,
292 : !> containing a (set of `npnt`) point(s) in the `ndim`-dimensional Euclidean space whose distances with respect to the input reference point `ref` must be returned.<br>
293 : !> (**optional**. It must be present **if and only if** the input arguments `x`, `y`, `z` are missing.)
294 : !> \param[in] ref : The input `contiguous` vector of shape `(1:ndim)` or matrix of shape `(1:ndim, 1:nref)` of the same type and kind as `point`,
295 : !> containing the (set of `nref`) reference point(s) from which the distance(s) of `point` must be computed.<br>
296 : !> (**optional**, default = `[(0., i = 1, size(point, 1))]`. It can be present **only if** the input argument `point` is also present.)
297 : !> \param[in] method : The input scalar that can be,<br>
298 : !> <ol>
299 : !> <li> the constant [euclid](@ref pm_distanceEuclid::euclid) or an object of type [euclid_type](@ref pm_distanceEuclid::euclid_type),
300 : !> implying that all distance calculations must be done without undue numerical overflow.<br>
301 : !> This option is computationally the most expensive method.<br>
302 : !> <li> the constant [euclidu](@ref pm_distanceEuclid::euclidu) or an object of type [euclidu_type](@ref pm_distanceEuclid::euclidu_type),
303 : !> implying that all distance calculations must be **without** runtime checks for numerical overflow.<br>
304 : !> This option is computationally faster than the [euclid](@ref pm_distanceEuclid::euclid) method.<br>
305 : !> <li> the constant [euclidsq](@ref pm_distanceEuclid::euclidsq) or an object of type [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)
306 : !> implying that the **squared** values of all distance calculations must be returned **without** runtime checks for numerical overflow.<br>
307 : !> This option is computationally the fastest approach to computing the distances because it avoid costly `sqrt()` operations and runtime overflow checks.<br>
308 : !> </ol>
309 : !> (**optional**, default = [euclid](@ref pm_distanceEuclid::euclid))
310 : !>
311 : !> \return
312 : !> `distance` : The output object of,
313 : !> <ol>
314 : !> <li> type `real` of kind \RKALL,
315 : !> </ol>
316 : !> containing the requested Euclidean (squared) distance(s).<br>
317 : !> The rank and shape of the output `distance` follows that of the interfaces illustrated below.<br>
318 : !>
319 : !> \interface{getDisEuclid}
320 : !> \code{.F90}
321 : !>
322 : !> use pm_distanceEuclid, only: getDisEuclid
323 : !>
324 : !> ! distance with respect to origin.
325 : !>
326 : !> distance = getDisEuclid(x, y, z) ! elemental
327 : !> distance = getDisEuclid(point(1:ndim), method = method)
328 : !> distance(1:npnt) = getDisEuclid(point(1:ndim, 1:npnt), method = method)
329 : !>
330 : !> ! distance with respect to origin.
331 : !>
332 : !> distance = getDisEuclid(point(1:ndim), ref(1:ndim), method = method)
333 : !> distance(1:nref) = getDisEuclid(point(1:ndim), ref(1:ndim, 1:nref), method = method)
334 : !> distance(1:npnt) = getDisEuclid(point(1:ndim, 1:npnt), ref(1:ndim), method = method)
335 : !> distance(1:npnt, 1:nref) = getDisEuclid(point(1:ndim, 1:npnt), ref(1:ndim, 1:nref), method = method)
336 : !> !
337 : !> \endcode
338 : !>
339 : !> \warning
340 : !> The condition `size(point, 1) == size(ref, 1)` must hold for the corresponding input arguments.<br>
341 : !> \vericon
342 : !>
343 : !> \warnpure
344 : !>
345 : !> \elemental
346 : !> The `elemental` attribute does not apply to interfaces that take `point` as an input argument.<br>
347 : !>
348 : !> \note
349 : !> The Fortran standard provides the intrinsic procedure `norm2()` for computing the Euclidean norm of a vector.<br>
350 : !> However, the standard does not enforce robustness of the intrinsic procedure with respect to possible underflows or overflows.<br>
351 : !> The procedures of this module ensure robustness of the distance computations.<br>
352 : !> This will inevitably lead to worse runtime performance compared to the compiler
353 : !> implementations of the intrinsic routine that do not respect robustness.<br>
354 : !> Use the routines of this module in place of the Fortran intrinsics
355 : !> if you believe there is a possibility of under/over-flow.
356 : !>
357 : !> \note
358 : !> The procedures of this module can be used for a robust computation of `abs(x)` when `x` is a large `complex` value.<br>
359 : !> In such a case, calling [getDisEuclid([x%re, x%im])](@ref pm_distanceEuclid::getDisEuclid) would be equivalent to `abs(x)` intrinsic operation.<br>
360 : !> However, note that the Fortran standard already offers a better intrinsic alternative to the routines of this procedure for this task,
361 : !> namely `hypot()` which is robust against overflow and underflow.<br>
362 : !>
363 : !> \note
364 : !> This generic interface intentionally does not have explicit procedures for 2D Euclidean
365 : !> distance `(x, y)` because the Fortran intrinsic procedure `hypot()` already serves the purpose.<br>
366 : !>
367 : !> \lapack{3.11}
368 : !> `dlapy3`
369 : !>
370 : !> \see
371 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
372 : !> [setDisEuclid](@ref pm_distanceEuclid::setDisEuclid)<br>
373 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
374 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
375 : !> Intrinsic Fortran procedure `hypot(x, y)` (robust)<br>
376 : !> Intrinsic Fortran procedure `norm2(x(:))` (unsafe)<br>
377 : !>
378 : !> \lapack{3.11}
379 : !> `dlapy3`
380 : !>
381 : !> \example{getDisEuclid}
382 : !> \include{lineno} example/pm_distanceEuclid/getDisEuclid/main.F90
383 : !> \compilef{getDisEuclid}
384 : !> \output{getDisEuclid}
385 : !> \include{lineno} example/pm_distanceEuclid/getDisEuclid/main.out.F90
386 : !>
387 : !> \test
388 : !> [test_pm_distanceEuclid](@ref test_pm_distanceEuclid)
389 : !>
390 : !> \todo
391 : !> \pmed
392 : !> A benchmark comparison with the equivalent compiler implementations would be informative.
393 : !>
394 : !> \finmain{getDisEuclid}
395 : !>
396 : !> \author
397 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
398 :
399 : ! x, y, z
400 :
401 : interface getDisEuclid
402 :
403 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404 :
405 : #if RK5_ENABLED
406 : pure elemental module function getDisEuclidXYZ_RK5(x, y, z) result(distance)
407 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
408 : !DEC$ ATTRIBUTES DLLEXPORT :: getDisEuclidXYZ_RK5
409 : #endif
410 : use pm_kind, only: RKC => RK5
411 : real(RKC) , intent(in) :: x, y, z
412 : real(RKC) :: distance
413 : end function
414 : #endif
415 :
416 : #if RK4_ENABLED
417 : pure elemental module function getDisEuclidXYZ_RK4(x, y, z) result(distance)
418 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
419 : !DEC$ ATTRIBUTES DLLEXPORT :: getDisEuclidXYZ_RK4
420 : #endif
421 : use pm_kind, only: RKC => RK4
422 : real(RKC) , intent(in) :: x, y, z
423 : real(RKC) :: distance
424 : end function
425 : #endif
426 :
427 : #if RK3_ENABLED
428 : PURE elemental module function getDisEuclidXYZ_RK3(x, y, z) result(distance)
429 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
430 : !DEC$ ATTRIBUTES DLLEXPORT :: getDisEuclidXYZ_RK3
431 : #endif
432 : use pm_kind, only: RKC => RK3
433 : real(RKC) , intent(in) :: x, y, z
434 : real(RKC) :: distance
435 : end function
436 : #endif
437 :
438 : #if RK2_ENABLED
439 : PURE elemental module function getDisEuclidXYZ_RK2(x, y, z) result(distance)
440 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
441 : !DEC$ ATTRIBUTES DLLEXPORT :: getDisEuclidXYZ_RK2
442 : #endif
443 : use pm_kind, only: RKC => RK2
444 : real(RKC) , intent(in) :: x, y, z
445 : real(RKC) :: distance
446 : end function
447 : #endif
448 :
449 : #if RK1_ENABLED
450 : PURE elemental module function getDisEuclidXYZ_RK1(x, y, z) result(distance)
451 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
452 : !DEC$ ATTRIBUTES DLLEXPORT :: getDisEuclidXYZ_RK1
453 : #endif
454 : use pm_kind, only: RKC => RK1
455 : real(RKC) , intent(in) :: x, y, z
456 : real(RKC) :: distance
457 : end function
458 : #endif
459 :
460 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461 :
462 : end interface
463 :
464 : ! vector, matrix
465 :
466 : interface getDisEuclid
467 :
468 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
469 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
470 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
471 :
472 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473 :
474 : #if RK5_ENABLED
475 : PURE module function getDE_D1_XX_RK5(point, method) result(distance)
476 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
477 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_XX_RK5
478 : #endif
479 : use pm_kind, only: RKC => RK5
480 : real(RKC) , intent(in) , contiguous :: point(:)
481 : real(RKC) :: distance
482 : class(*) , intent(in) , optional :: method
483 : end function
484 : #endif
485 :
486 : #if RK4_ENABLED
487 : PURE module function getDE_D1_XX_RK4(point, method) result(distance)
488 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
489 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_XX_RK4
490 : #endif
491 : use pm_kind, only: RKC => RK4
492 : real(RKC) , intent(in) , contiguous :: point(:)
493 : real(RKC) :: distance
494 : class(*) , intent(in) , optional :: method
495 : end function
496 : #endif
497 :
498 : #if RK3_ENABLED
499 : PURE module function getDE_D1_XX_RK3(point, method) result(distance)
500 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
501 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_XX_RK3
502 : #endif
503 : use pm_kind, only: RKC => RK3
504 : real(RKC) , intent(in) , contiguous :: point(:)
505 : real(RKC) :: distance
506 : class(*) , intent(in) , optional :: method
507 : end function
508 : #endif
509 :
510 : #if RK2_ENABLED
511 : PURE module function getDE_D1_XX_RK2(point, method) result(distance)
512 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
513 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_XX_RK2
514 : #endif
515 : use pm_kind, only: RKC => RK2
516 : real(RKC) , intent(in) , contiguous :: point(:)
517 : real(RKC) :: distance
518 : class(*) , intent(in) , optional :: method
519 : end function
520 : #endif
521 :
522 : #if RK1_ENABLED
523 : PURE module function getDE_D1_XX_RK1(point, method) result(distance)
524 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
525 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_XX_RK1
526 : #endif
527 : use pm_kind, only: RKC => RK1
528 : real(RKC) , intent(in) , contiguous :: point(:)
529 : real(RKC) :: distance
530 : class(*) , intent(in) , optional :: method
531 : end function
532 : #endif
533 :
534 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
535 :
536 : #if RK5_ENABLED
537 : PURE module function getDE_D2_XX_RK5(point, method) result(distance)
538 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
539 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_XX_RK5
540 : #endif
541 : use pm_kind, only: RKC => RK5
542 : real(RKC) , intent(in) , contiguous :: point(:,:)
543 : real(RKC) :: distance(size(point, 2, IK))
544 : class(*) , intent(in) , optional :: method
545 : end function
546 : #endif
547 :
548 : #if RK4_ENABLED
549 : PURE module function getDE_D2_XX_RK4(point, method) result(distance)
550 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
551 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_XX_RK4
552 : #endif
553 : use pm_kind, only: RKC => RK4
554 : real(RKC) , intent(in) , contiguous :: point(:,:)
555 : real(RKC) :: distance(size(point, 2, IK))
556 : class(*) , intent(in) , optional :: method
557 : end function
558 : #endif
559 :
560 : #if RK3_ENABLED
561 : PURE module function getDE_D2_XX_RK3(point, method) result(distance)
562 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
563 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_XX_RK3
564 : #endif
565 : use pm_kind, only: RKC => RK3
566 : real(RKC) , intent(in) , contiguous :: point(:,:)
567 : real(RKC) :: distance(size(point, 2, IK))
568 : class(*) , intent(in) , optional :: method
569 : end function
570 : #endif
571 :
572 : #if RK2_ENABLED
573 : PURE module function getDE_D2_XX_RK2(point, method) result(distance)
574 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
575 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_XX_RK2
576 : #endif
577 : use pm_kind, only: RKC => RK2
578 : real(RKC) , intent(in) , contiguous :: point(:,:)
579 : real(RKC) :: distance(size(point, 2, IK))
580 : class(*) , intent(in) , optional :: method
581 : end function
582 : #endif
583 :
584 : #if RK1_ENABLED
585 : PURE module function getDE_D2_XX_RK1(point, method) result(distance)
586 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
587 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_XX_RK1
588 : #endif
589 : use pm_kind, only: RKC => RK1
590 : real(RKC) , intent(in) , contiguous :: point(:,:)
591 : real(RKC) :: distance(size(point, 2, IK))
592 : class(*) , intent(in) , optional :: method
593 : end function
594 : #endif
595 :
596 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
597 :
598 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
599 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
600 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
601 :
602 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
603 :
604 : #if RK5_ENABLED
605 : PURE module function getDE_D1_D1_RK5(point, ref, method) result(distance)
606 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
607 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D1_RK5
608 : #endif
609 : use pm_kind, only: RKC => RK5
610 : real(RKC) , intent(in) , contiguous :: ref(:)
611 : real(RKC) , intent(in) , contiguous :: point(:)
612 : real(RKC) :: distance
613 : class(*) , intent(in) , optional :: method
614 : end function
615 : #endif
616 :
617 : #if RK4_ENABLED
618 : PURE module function getDE_D1_D1_RK4(point, ref, method) result(distance)
619 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
620 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D1_RK4
621 : #endif
622 : use pm_kind, only: RKC => RK4
623 : real(RKC) , intent(in) , contiguous :: ref(:)
624 : real(RKC) , intent(in) , contiguous :: point(:)
625 : real(RKC) :: distance
626 : class(*) , intent(in) , optional :: method
627 : end function
628 : #endif
629 :
630 : #if RK3_ENABLED
631 : PURE module function getDE_D1_D1_RK3(point, ref, method) result(distance)
632 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
633 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D1_RK3
634 : #endif
635 : use pm_kind, only: RKC => RK3
636 : real(RKC) , intent(in) , contiguous :: ref(:)
637 : real(RKC) , intent(in) , contiguous :: point(:)
638 : real(RKC) :: distance
639 : class(*) , intent(in) , optional :: method
640 : end function
641 : #endif
642 :
643 : #if RK2_ENABLED
644 : PURE module function getDE_D1_D1_RK2(point, ref, method) result(distance)
645 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
646 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D1_RK2
647 : #endif
648 : use pm_kind, only: RKC => RK2
649 : real(RKC) , intent(in) , contiguous :: ref(:)
650 : real(RKC) , intent(in) , contiguous :: point(:)
651 : real(RKC) :: distance
652 : class(*) , intent(in) , optional :: method
653 : end function
654 : #endif
655 :
656 : #if RK1_ENABLED
657 : PURE module function getDE_D1_D1_RK1(point, ref, method) result(distance)
658 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
659 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D1_RK1
660 : #endif
661 : use pm_kind, only: RKC => RK1
662 : real(RKC) , intent(in) , contiguous :: ref(:)
663 : real(RKC) , intent(in) , contiguous :: point(:)
664 : real(RKC) :: distance
665 : class(*) , intent(in) , optional :: method
666 : end function
667 : #endif
668 :
669 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
670 :
671 : #if RK5_ENABLED
672 : PURE module function getDE_D1_D2_RK5(point, ref, method) result(distance)
673 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
674 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D2_RK5
675 : #endif
676 : use pm_kind, only: RKC => RK5
677 : real(RKC) , intent(in) , contiguous :: ref(:,:)
678 : real(RKC) , intent(in) , contiguous :: point(:)
679 : real(RKC) :: distance(size(ref, 2, IK))
680 : class(*) , intent(in) , optional :: method
681 : end function
682 : #endif
683 :
684 : #if RK4_ENABLED
685 : PURE module function getDE_D1_D2_RK4(point, ref, method) result(distance)
686 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
687 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D2_RK4
688 : #endif
689 : use pm_kind, only: RKC => RK4
690 : real(RKC) , intent(in) , contiguous :: ref(:,:)
691 : real(RKC) , intent(in) , contiguous :: point(:)
692 : real(RKC) :: distance(size(ref, 2, IK))
693 : class(*) , intent(in) , optional :: method
694 : end function
695 : #endif
696 :
697 : #if RK3_ENABLED
698 : PURE module function getDE_D1_D2_RK3(point, ref, method) result(distance)
699 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
700 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D2_RK3
701 : #endif
702 : use pm_kind, only: RKC => RK3
703 : real(RKC) , intent(in) , contiguous :: ref(:,:)
704 : real(RKC) , intent(in) , contiguous :: point(:)
705 : real(RKC) :: distance(size(ref, 2, IK))
706 : class(*) , intent(in) , optional :: method
707 : end function
708 : #endif
709 :
710 : #if RK2_ENABLED
711 : PURE module function getDE_D1_D2_RK2(point, ref, method) result(distance)
712 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
713 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D2_RK2
714 : #endif
715 : use pm_kind, only: RKC => RK2
716 : real(RKC) , intent(in) , contiguous :: ref(:,:)
717 : real(RKC) , intent(in) , contiguous :: point(:)
718 : real(RKC) :: distance(size(ref, 2, IK))
719 : class(*) , intent(in) , optional :: method
720 : end function
721 : #endif
722 :
723 : #if RK1_ENABLED
724 : PURE module function getDE_D1_D2_RK1(point, ref, method) result(distance)
725 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
726 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D1_D2_RK1
727 : #endif
728 : use pm_kind, only: RKC => RK1
729 : real(RKC) , intent(in) , contiguous :: ref(:,:)
730 : real(RKC) , intent(in) , contiguous :: point(:)
731 : real(RKC) :: distance(size(ref, 2, IK))
732 : class(*) , intent(in) , optional :: method
733 : end function
734 : #endif
735 :
736 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
737 :
738 : #if RK5_ENABLED
739 : PURE module function getDE_D2_D1_RK5(point, ref, method) result(distance)
740 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
741 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D1_RK5
742 : #endif
743 : use pm_kind, only: RKC => RK5
744 : real(RKC) , intent(in) , contiguous :: ref(:)
745 : real(RKC) , intent(in) , contiguous :: point(:,:)
746 : real(RKC) :: distance(size(point, 2, IK))
747 : class(*) , intent(in) , optional :: method
748 : end function
749 : #endif
750 :
751 : #if RK4_ENABLED
752 : PURE module function getDE_D2_D1_RK4(point, ref, method) result(distance)
753 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
754 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D1_RK4
755 : #endif
756 : use pm_kind, only: RKC => RK4
757 : real(RKC) , intent(in) , contiguous :: ref(:)
758 : real(RKC) , intent(in) , contiguous :: point(:,:)
759 : real(RKC) :: distance(size(point, 2, IK))
760 : class(*) , intent(in) , optional :: method
761 : end function
762 : #endif
763 :
764 : #if RK3_ENABLED
765 : PURE module function getDE_D2_D1_RK3(point, ref, method) result(distance)
766 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
767 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D1_RK3
768 : #endif
769 : use pm_kind, only: RKC => RK3
770 : real(RKC) , intent(in) , contiguous :: ref(:)
771 : real(RKC) , intent(in) , contiguous :: point(:,:)
772 : real(RKC) :: distance(size(point, 2, IK))
773 : class(*) , intent(in) , optional :: method
774 : end function
775 : #endif
776 :
777 : #if RK2_ENABLED
778 : PURE module function getDE_D2_D1_RK2(point, ref, method) result(distance)
779 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
780 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D1_RK2
781 : #endif
782 : use pm_kind, only: RKC => RK2
783 : real(RKC) , intent(in) , contiguous :: ref(:)
784 : real(RKC) , intent(in) , contiguous :: point(:,:)
785 : real(RKC) :: distance(size(point, 2, IK))
786 : class(*) , intent(in) , optional :: method
787 : end function
788 : #endif
789 :
790 : #if RK1_ENABLED
791 : PURE module function getDE_D2_D1_RK1(point, ref, method) result(distance)
792 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
793 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D1_RK1
794 : #endif
795 : use pm_kind, only: RKC => RK1
796 : real(RKC) , intent(in) , contiguous :: ref(:)
797 : real(RKC) , intent(in) , contiguous :: point(:,:)
798 : real(RKC) :: distance(size(point, 2, IK))
799 : class(*) , intent(in) , optional :: method
800 : end function
801 : #endif
802 :
803 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
804 :
805 : #if RK5_ENABLED
806 : PURE module function getDE_D2_D2_RK5(point, ref, method) result(distance)
807 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
808 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D2_RK5
809 : #endif
810 : use pm_kind, only: RKC => RK5
811 : real(RKC) , intent(in) , contiguous :: ref(:,:)
812 : real(RKC) , intent(in) , contiguous :: point(:,:)
813 : real(RKC) :: distance(size(ref, 2, IK), size(point, 2, IK))
814 : class(*) , intent(in) , optional :: method
815 : end function
816 : #endif
817 :
818 : #if RK4_ENABLED
819 : PURE module function getDE_D2_D2_RK4(point, ref, method) result(distance)
820 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
821 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D2_RK4
822 : #endif
823 : use pm_kind, only: RKC => RK4
824 : real(RKC) , intent(in) , contiguous :: ref(:,:)
825 : real(RKC) , intent(in) , contiguous :: point(:,:)
826 : real(RKC) :: distance(size(ref, 2, IK), size(point, 2, IK))
827 : class(*) , intent(in) , optional :: method
828 : end function
829 : #endif
830 :
831 : #if RK3_ENABLED
832 : PURE module function getDE_D2_D2_RK3(point, ref, method) result(distance)
833 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
834 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D2_RK3
835 : #endif
836 : use pm_kind, only: RKC => RK3
837 : real(RKC) , intent(in) , contiguous :: ref(:,:)
838 : real(RKC) , intent(in) , contiguous :: point(:,:)
839 : real(RKC) :: distance(size(ref, 2, IK), size(point, 2, IK))
840 : class(*) , intent(in) , optional :: method
841 : end function
842 : #endif
843 :
844 : #if RK2_ENABLED
845 : PURE module function getDE_D2_D2_RK2(point, ref, method) result(distance)
846 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
847 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D2_RK2
848 : #endif
849 : use pm_kind, only: RKC => RK2
850 : real(RKC) , intent(in) , contiguous :: ref(:,:)
851 : real(RKC) , intent(in) , contiguous :: point(:,:)
852 : real(RKC) :: distance(size(ref, 2, IK), size(point, 2, IK))
853 : class(*) , intent(in) , optional :: method
854 : end function
855 : #endif
856 :
857 : #if RK1_ENABLED
858 : PURE module function getDE_D2_D2_RK1(point, ref, method) result(distance)
859 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
860 : !DEC$ ATTRIBUTES DLLEXPORT :: getDE_D2_D2_RK1
861 : #endif
862 : use pm_kind, only: RKC => RK1
863 : real(RKC) , intent(in) , contiguous :: ref(:,:)
864 : real(RKC) , intent(in) , contiguous :: point(:,:)
865 : real(RKC) :: distance(size(ref, 2, IK), size(point, 2, IK))
866 : class(*) , intent(in) , optional :: method
867 : end function
868 : #endif
869 :
870 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
871 :
872 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
873 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
874 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
875 :
876 : end interface
877 :
878 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
879 :
880 : !> \brief
881 : !> Generate and return the (squared) Euclidean distance of a (set of) point(s) in `ndim`-dimensions from a reference point (possibly origin),
882 : !> optionally robustly without underflow or overflow.<br>
883 : !>
884 : !> \param[out] distance : The output object of,
885 : !> <ol>
886 : !> <li> type `real` of kind \RKALL,
887 : !> </ol>
888 : !> containing the requested Euclidean (squared) distance(s).<br>
889 : !> The rank and shape of the output `distance` follows that of the interfaces illustrated below.<br>
890 : !> \param[in] point : The input `contiguous` vector of shape `(1:ndim)` or matrix of shape `(1:ndim, 1:npnt)` of the same type and kind as the output `distance`,
891 : !> containing a (set of `npnt`) point(s) in the `ndim`-dimensional Euclidean space whose distances with respect to the input reference point `ref` must be returned.<br>
892 : !> \param[in] ref : The input `contiguous` vector of shape `(1:ndim)` or matrix of shape `(1:ndim, 1:nref)` of the same type and kind as `point`,
893 : !> containing the (set of `nref`) reference point(s) from which the distance(s) of `point` must be computed.<br>
894 : !> (**optional**, default = `[(0., i = 1, size(point, 1))]`.)
895 : !> \param[in] method : The input scalar that can be,<br>
896 : !> <ol>
897 : !> <li> the constant [euclid](@ref pm_distanceEuclid::euclid) or an object of type [euclid_type](@ref pm_distanceEuclid::euclid_type),
898 : !> implying that all distance calculations must be done without undue numerical overflow.<br>
899 : !> This option is computationally the most expensive method.<br>
900 : !> <li> the constant [euclidu](@ref pm_distanceEuclid::euclidu) or an object of type [euclidu_type](@ref pm_distanceEuclid::euclidu_type),
901 : !> implying that all distance calculations must be **without** runtime checks for numerical overflow.<br>
902 : !> This option is computationally faster than the [euclid](@ref pm_distanceEuclid::euclid) method.<br>
903 : !> <li> the constant [euclidsq](@ref pm_distanceEuclid::euclidsq) or an object of type [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)
904 : !> implying that the **squared** values of all distance calculations must be returned **without** runtime checks for numerical overflow.<br>
905 : !> This option is computationally the fastest approach to computing the distances because it avoid costly `sqrt()` operations and runtime overflow checks.<br>
906 : !> </ol>
907 : !> (**optional**, default = [euclid](@ref pm_distanceEuclid::euclid))
908 : !>
909 : !> \interface{setDisEuclid}
910 : !> \code{.F90}
911 : !>
912 : !> use pm_distanceEuclid, only: setDisEuclid
913 : !>
914 : !> ! distance with respect to origin.
915 : !>
916 : !> call setDisEuclid(distance, point(1:ndim), method)
917 : !> call setDisEuclid(distance(1:npnt), point(1:ndim, 1:npnt), method)
918 : !>
919 : !> ! distance with respect to origin.
920 : !>
921 : !> call setDisEuclid(distance, point(1:ndim), ref(1:ndim), method)
922 : !> call setDisEuclid(distance(1:nref), point(1:ndim), ref(1:ndim, 1:nref), method)
923 : !> call setDisEuclid(distance(1:npnt), point(1:ndim, 1:npnt), ref(1:ndim), method)
924 : !> call setDisEuclid(distance(1:npnt, 1:nref), point(1:ndim, 1:npnt), ref(1:ndim, 1:nref), method)
925 : !> !
926 : !> \endcode
927 : !>
928 : !> \warning
929 : !> The condition `size(point, 1) == size(ref, 1)` must hold for the corresponding input arguments.<br>
930 : !> The shapes of `distance`, `point`, and `ref` must be consistent as in the above interface at all times.<br>
931 : !> \vericons
932 : !>
933 : !> \warnpure
934 : !>
935 : !> \lapack{3.11}
936 : !> `dlapy3`
937 : !>
938 : !> \see
939 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
940 : !> [setDisEuclid](@ref pm_distanceEuclid::setDisEuclid)<br>
941 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
942 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
943 : !> Intrinsic Fortran procedure `hypot(x, y)` (robust)<br>
944 : !> Intrinsic Fortran procedure `norm2(x(:))` (unsafe)<br>
945 : !>
946 : !> \example{setDisEuclid}
947 : !> \include{lineno} example/pm_distanceEuclid/setDisEuclid/main.F90
948 : !> \compilef{setDisEuclid}
949 : !> \output{setDisEuclid}
950 : !> \include{lineno} example/pm_distanceEuclid/setDisEuclid/main.out.F90
951 : !>
952 : !> \test
953 : !> [test_pm_distanceEuclid](@ref test_pm_distanceEuclid)
954 : !>
955 : !> \naming
956 : !> \code{.F90}
957 : !> setDE_MEQ_D1_D2_RK5()
958 : !> || ||| || || |||
959 : !> || ||| || || The type and kind parameters.
960 : !> || ||| || The dimension of `ref` array: D1 => vector, D2 => matrix, XX => `ref` missing.
961 : !> || ||| The dimension of `point` array: D1 => vector, D2 => matrix.
962 : !> || The Method of Euclidean distance computation: MED => euclid_type (default/safe), MEU => eulidu_type (unsafe), MEQ => eulidsq_type (squared)
963 : !> The abbreviation for DisEuclid to shorten procedure names.
964 : !> \endcode
965 : !>
966 : !> \todo
967 : !> \pmed
968 : !> A benchmark comparison with the equivalent compiler implementations would be informative.
969 : !>
970 : !> \finmain{setDisEuclid}
971 : !>
972 : !> \author
973 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
974 :
975 : ! euclid
976 :
977 : interface setDisEuclid
978 :
979 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
980 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
981 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
982 :
983 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
984 :
985 : #if RK5_ENABLED
986 : PURE module subroutine setDE_MED_D1_XX_RK5(distance, point, method)
987 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
988 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_XX_RK5
989 : #endif
990 : use pm_kind, only: RKC => RK5
991 : real(RKC) , intent(in) , contiguous :: point(:)
992 : real(RKC) , intent(out) :: distance
993 : type(euclid_type) , intent(in) :: method
994 : end subroutine
995 : #endif
996 :
997 : #if RK4_ENABLED
998 : PURE module subroutine setDE_MED_D1_XX_RK4(distance, point, method)
999 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1000 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_XX_RK4
1001 : #endif
1002 : use pm_kind, only: RKC => RK4
1003 : real(RKC) , intent(in) , contiguous :: point(:)
1004 : real(RKC) , intent(out) :: distance
1005 : type(euclid_type) , intent(in) :: method
1006 : end subroutine
1007 : #endif
1008 :
1009 : #if RK3_ENABLED
1010 : PURE module subroutine setDE_MED_D1_XX_RK3(distance, point, method)
1011 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1012 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_XX_RK3
1013 : #endif
1014 : use pm_kind, only: RKC => RK3
1015 : real(RKC) , intent(in) , contiguous :: point(:)
1016 : real(RKC) , intent(out) :: distance
1017 : type(euclid_type) , intent(in) :: method
1018 : end subroutine
1019 : #endif
1020 :
1021 : #if RK2_ENABLED
1022 : PURE module subroutine setDE_MED_D1_XX_RK2(distance, point, method)
1023 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1024 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_XX_RK2
1025 : #endif
1026 : use pm_kind, only: RKC => RK2
1027 : real(RKC) , intent(in) , contiguous :: point(:)
1028 : real(RKC) , intent(out) :: distance
1029 : type(euclid_type) , intent(in) :: method
1030 : end subroutine
1031 : #endif
1032 :
1033 : #if RK1_ENABLED
1034 : PURE module subroutine setDE_MED_D1_XX_RK1(distance, point, method)
1035 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1036 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_XX_RK1
1037 : #endif
1038 : use pm_kind, only: RKC => RK1
1039 : real(RKC) , intent(in) , contiguous :: point(:)
1040 : real(RKC) , intent(out) :: distance
1041 : type(euclid_type) , intent(in) :: method
1042 : end subroutine
1043 : #endif
1044 :
1045 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1046 :
1047 : #if RK5_ENABLED
1048 : PURE module subroutine setDE_MED_D2_XX_RK5(distance, point, method)
1049 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1050 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_XX_RK5
1051 : #endif
1052 : use pm_kind, only: RKC => RK5
1053 : real(RKC) , intent(in) , contiguous :: point(:,:)
1054 : real(RKC) , intent(out) , contiguous :: distance(:)
1055 : type(euclid_type) , intent(in) :: method
1056 : end subroutine
1057 : #endif
1058 :
1059 : #if RK4_ENABLED
1060 : PURE module subroutine setDE_MED_D2_XX_RK4(distance, point, method)
1061 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1062 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_XX_RK4
1063 : #endif
1064 : use pm_kind, only: RKC => RK4
1065 : real(RKC) , intent(in) , contiguous :: point(:,:)
1066 : real(RKC) , intent(out) , contiguous :: distance(:)
1067 : type(euclid_type) , intent(in) :: method
1068 : end subroutine
1069 : #endif
1070 :
1071 : #if RK3_ENABLED
1072 : PURE module subroutine setDE_MED_D2_XX_RK3(distance, point, method)
1073 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1074 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_XX_RK3
1075 : #endif
1076 : use pm_kind, only: RKC => RK3
1077 : real(RKC) , intent(in) , contiguous :: point(:,:)
1078 : real(RKC) , intent(out) , contiguous :: distance(:)
1079 : type(euclid_type) , intent(in) :: method
1080 : end subroutine
1081 : #endif
1082 :
1083 : #if RK2_ENABLED
1084 : PURE module subroutine setDE_MED_D2_XX_RK2(distance, point, method)
1085 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1086 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_XX_RK2
1087 : #endif
1088 : use pm_kind, only: RKC => RK2
1089 : real(RKC) , intent(in) , contiguous :: point(:,:)
1090 : real(RKC) , intent(out) , contiguous :: distance(:)
1091 : type(euclid_type) , intent(in) :: method
1092 : end subroutine
1093 : #endif
1094 :
1095 : #if RK1_ENABLED
1096 : PURE module subroutine setDE_MED_D2_XX_RK1(distance, point, method)
1097 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1098 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_XX_RK1
1099 : #endif
1100 : use pm_kind, only: RKC => RK1
1101 : real(RKC) , intent(in) , contiguous :: point(:,:)
1102 : real(RKC) , intent(out) , contiguous :: distance(:)
1103 : type(euclid_type) , intent(in) :: method
1104 : end subroutine
1105 : #endif
1106 :
1107 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1108 :
1109 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1110 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112 :
1113 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1114 :
1115 : #if RK5_ENABLED
1116 : PURE module subroutine setDE_MED_D1_D1_RK5(distance, point, ref, method)
1117 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1118 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D1_RK5
1119 : #endif
1120 : use pm_kind, only: RKC => RK5
1121 : real(RKC) , intent(in) , contiguous :: ref(:)
1122 : real(RKC) , intent(in) , contiguous :: point(:)
1123 : real(RKC) , intent(out) :: distance
1124 : type(euclid_type) , intent(in) :: method
1125 : end subroutine
1126 : #endif
1127 :
1128 : #if RK4_ENABLED
1129 : PURE module subroutine setDE_MED_D1_D1_RK4(distance, point, ref, method)
1130 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1131 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D1_RK4
1132 : #endif
1133 : use pm_kind, only: RKC => RK4
1134 : real(RKC) , intent(in) , contiguous :: ref(:)
1135 : real(RKC) , intent(in) , contiguous :: point(:)
1136 : real(RKC) , intent(out) :: distance
1137 : type(euclid_type) , intent(in) :: method
1138 : end subroutine
1139 : #endif
1140 :
1141 : #if RK3_ENABLED
1142 : PURE module subroutine setDE_MED_D1_D1_RK3(distance, point, ref, method)
1143 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1144 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D1_RK3
1145 : #endif
1146 : use pm_kind, only: RKC => RK3
1147 : real(RKC) , intent(in) , contiguous :: ref(:)
1148 : real(RKC) , intent(in) , contiguous :: point(:)
1149 : real(RKC) , intent(out) :: distance
1150 : type(euclid_type) , intent(in) :: method
1151 : end subroutine
1152 : #endif
1153 :
1154 : #if RK2_ENABLED
1155 : PURE module subroutine setDE_MED_D1_D1_RK2(distance, point, ref, method)
1156 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1157 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D1_RK2
1158 : #endif
1159 : use pm_kind, only: RKC => RK2
1160 : real(RKC) , intent(in) , contiguous :: ref(:)
1161 : real(RKC) , intent(in) , contiguous :: point(:)
1162 : real(RKC) , intent(out) :: distance
1163 : type(euclid_type) , intent(in) :: method
1164 : end subroutine
1165 : #endif
1166 :
1167 : #if RK1_ENABLED
1168 : PURE module subroutine setDE_MED_D1_D1_RK1(distance, point, ref, method)
1169 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1170 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D1_RK1
1171 : #endif
1172 : use pm_kind, only: RKC => RK1
1173 : real(RKC) , intent(in) , contiguous :: ref(:)
1174 : real(RKC) , intent(in) , contiguous :: point(:)
1175 : real(RKC) , intent(out) :: distance
1176 : type(euclid_type) , intent(in) :: method
1177 : end subroutine
1178 : #endif
1179 :
1180 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1181 :
1182 : #if RK5_ENABLED
1183 : PURE module subroutine setDE_MED_D1_D2_RK5(distance, point, ref, method)
1184 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1185 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D2_RK5
1186 : #endif
1187 : use pm_kind, only: RKC => RK5
1188 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1189 : real(RKC) , intent(in) , contiguous :: point(:)
1190 : real(RKC) , intent(out) , contiguous :: distance(:)
1191 : type(euclid_type) , intent(in) :: method
1192 : end subroutine
1193 : #endif
1194 :
1195 : #if RK4_ENABLED
1196 : PURE module subroutine setDE_MED_D1_D2_RK4(distance, point, ref, method)
1197 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1198 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D2_RK4
1199 : #endif
1200 : use pm_kind, only: RKC => RK4
1201 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1202 : real(RKC) , intent(in) , contiguous :: point(:)
1203 : real(RKC) , intent(out) , contiguous :: distance(:)
1204 : type(euclid_type) , intent(in) :: method
1205 : end subroutine
1206 : #endif
1207 :
1208 : #if RK3_ENABLED
1209 : PURE module subroutine setDE_MED_D1_D2_RK3(distance, point, ref, method)
1210 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1211 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D2_RK3
1212 : #endif
1213 : use pm_kind, only: RKC => RK3
1214 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1215 : real(RKC) , intent(in) , contiguous :: point(:)
1216 : real(RKC) , intent(out) , contiguous :: distance(:)
1217 : type(euclid_type) , intent(in) :: method
1218 : end subroutine
1219 : #endif
1220 :
1221 : #if RK2_ENABLED
1222 : PURE module subroutine setDE_MED_D1_D2_RK2(distance, point, ref, method)
1223 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1224 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D2_RK2
1225 : #endif
1226 : use pm_kind, only: RKC => RK2
1227 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1228 : real(RKC) , intent(in) , contiguous :: point(:)
1229 : real(RKC) , intent(out) , contiguous :: distance(:)
1230 : type(euclid_type) , intent(in) :: method
1231 : end subroutine
1232 : #endif
1233 :
1234 : #if RK1_ENABLED
1235 : PURE module subroutine setDE_MED_D1_D2_RK1(distance, point, ref, method)
1236 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1237 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D1_D2_RK1
1238 : #endif
1239 : use pm_kind, only: RKC => RK1
1240 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1241 : real(RKC) , intent(in) , contiguous :: point(:)
1242 : real(RKC) , intent(out) , contiguous :: distance(:)
1243 : type(euclid_type) , intent(in) :: method
1244 : end subroutine
1245 : #endif
1246 :
1247 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1248 :
1249 : #if RK5_ENABLED
1250 : PURE module subroutine setDE_MED_D2_D1_RK5(distance, point, ref, method)
1251 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1252 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D1_RK5
1253 : #endif
1254 : use pm_kind, only: RKC => RK5
1255 : real(RKC) , intent(in) , contiguous :: ref(:)
1256 : real(RKC) , intent(in) , contiguous :: point(:,:)
1257 : real(RKC) , intent(out) , contiguous :: distance(:)
1258 : type(euclid_type) , intent(in) :: method
1259 : end subroutine
1260 : #endif
1261 :
1262 : #if RK4_ENABLED
1263 : PURE module subroutine setDE_MED_D2_D1_RK4(distance, point, ref, method)
1264 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1265 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D1_RK4
1266 : #endif
1267 : use pm_kind, only: RKC => RK4
1268 : real(RKC) , intent(in) , contiguous :: ref(:)
1269 : real(RKC) , intent(in) , contiguous :: point(:,:)
1270 : real(RKC) , intent(out) , contiguous :: distance(:)
1271 : type(euclid_type) , intent(in) :: method
1272 : end subroutine
1273 : #endif
1274 :
1275 : #if RK3_ENABLED
1276 : PURE module subroutine setDE_MED_D2_D1_RK3(distance, point, ref, method)
1277 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1278 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D1_RK3
1279 : #endif
1280 : use pm_kind, only: RKC => RK3
1281 : real(RKC) , intent(in) , contiguous :: ref(:)
1282 : real(RKC) , intent(in) , contiguous :: point(:,:)
1283 : real(RKC) , intent(out) , contiguous :: distance(:)
1284 : type(euclid_type) , intent(in) :: method
1285 : end subroutine
1286 : #endif
1287 :
1288 : #if RK2_ENABLED
1289 : PURE module subroutine setDE_MED_D2_D1_RK2(distance, point, ref, method)
1290 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1291 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D1_RK2
1292 : #endif
1293 : use pm_kind, only: RKC => RK2
1294 : real(RKC) , intent(in) , contiguous :: ref(:)
1295 : real(RKC) , intent(in) , contiguous :: point(:,:)
1296 : real(RKC) , intent(out) , contiguous :: distance(:)
1297 : type(euclid_type) , intent(in) :: method
1298 : end subroutine
1299 : #endif
1300 :
1301 : #if RK1_ENABLED
1302 : PURE module subroutine setDE_MED_D2_D1_RK1(distance, point, ref, method)
1303 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1304 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D1_RK1
1305 : #endif
1306 : use pm_kind, only: RKC => RK1
1307 : real(RKC) , intent(in) , contiguous :: ref(:)
1308 : real(RKC) , intent(in) , contiguous :: point(:,:)
1309 : real(RKC) , intent(out) , contiguous :: distance(:)
1310 : type(euclid_type) , intent(in) :: method
1311 : end subroutine
1312 : #endif
1313 :
1314 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1315 :
1316 : #if RK5_ENABLED
1317 : PURE module subroutine setDE_MED_D2_D2_RK5(distance, point, ref, method)
1318 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1319 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D2_RK5
1320 : #endif
1321 : use pm_kind, only: RKC => RK5
1322 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1323 : real(RKC) , intent(in) , contiguous :: point(:,:)
1324 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1325 : type(euclid_type) , intent(in) :: method
1326 : end subroutine
1327 : #endif
1328 :
1329 : #if RK4_ENABLED
1330 : PURE module subroutine setDE_MED_D2_D2_RK4(distance, point, ref, method)
1331 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1332 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D2_RK4
1333 : #endif
1334 : use pm_kind, only: RKC => RK4
1335 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1336 : real(RKC) , intent(in) , contiguous :: point(:,:)
1337 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1338 : type(euclid_type) , intent(in) :: method
1339 : end subroutine
1340 : #endif
1341 :
1342 : #if RK3_ENABLED
1343 : PURE module subroutine setDE_MED_D2_D2_RK3(distance, point, ref, method)
1344 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1345 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D2_RK3
1346 : #endif
1347 : use pm_kind, only: RKC => RK3
1348 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1349 : real(RKC) , intent(in) , contiguous :: point(:,:)
1350 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1351 : type(euclid_type) , intent(in) :: method
1352 : end subroutine
1353 : #endif
1354 :
1355 : #if RK2_ENABLED
1356 : PURE module subroutine setDE_MED_D2_D2_RK2(distance, point, ref, method)
1357 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1358 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D2_RK2
1359 : #endif
1360 : use pm_kind, only: RKC => RK2
1361 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1362 : real(RKC) , intent(in) , contiguous :: point(:,:)
1363 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1364 : type(euclid_type) , intent(in) :: method
1365 : end subroutine
1366 : #endif
1367 :
1368 : #if RK1_ENABLED
1369 : PURE module subroutine setDE_MED_D2_D2_RK1(distance, point, ref, method)
1370 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1371 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MED_D2_D2_RK1
1372 : #endif
1373 : use pm_kind, only: RKC => RK1
1374 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1375 : real(RKC) , intent(in) , contiguous :: point(:,:)
1376 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1377 : type(euclid_type) , intent(in) :: method
1378 : end subroutine
1379 : #endif
1380 :
1381 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1382 :
1383 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1384 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1385 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1386 :
1387 : end interface
1388 :
1389 : ! euclidu
1390 :
1391 : interface setDisEuclid
1392 :
1393 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1394 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1395 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1396 :
1397 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1398 :
1399 : #if RK5_ENABLED
1400 : PURE module subroutine setDE_MEU_D1_XX_RK5(distance, point, method)
1401 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1402 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_XX_RK5
1403 : #endif
1404 : use pm_kind, only: RKC => RK5
1405 : real(RKC) , intent(in) , contiguous :: point(:)
1406 : real(RKC) , intent(out) :: distance
1407 : type(euclidu_type) , intent(in) :: method
1408 : end subroutine
1409 : #endif
1410 :
1411 : #if RK4_ENABLED
1412 : PURE module subroutine setDE_MEU_D1_XX_RK4(distance, point, method)
1413 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1414 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_XX_RK4
1415 : #endif
1416 : use pm_kind, only: RKC => RK4
1417 : real(RKC) , intent(in) , contiguous :: point(:)
1418 : real(RKC) , intent(out) :: distance
1419 : type(euclidu_type) , intent(in) :: method
1420 : end subroutine
1421 : #endif
1422 :
1423 : #if RK3_ENABLED
1424 : PURE module subroutine setDE_MEU_D1_XX_RK3(distance, point, method)
1425 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1426 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_XX_RK3
1427 : #endif
1428 : use pm_kind, only: RKC => RK3
1429 : real(RKC) , intent(in) , contiguous :: point(:)
1430 : real(RKC) , intent(out) :: distance
1431 : type(euclidu_type) , intent(in) :: method
1432 : end subroutine
1433 : #endif
1434 :
1435 : #if RK2_ENABLED
1436 : PURE module subroutine setDE_MEU_D1_XX_RK2(distance, point, method)
1437 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1438 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_XX_RK2
1439 : #endif
1440 : use pm_kind, only: RKC => RK2
1441 : real(RKC) , intent(in) , contiguous :: point(:)
1442 : real(RKC) , intent(out) :: distance
1443 : type(euclidu_type) , intent(in) :: method
1444 : end subroutine
1445 : #endif
1446 :
1447 : #if RK1_ENABLED
1448 : PURE module subroutine setDE_MEU_D1_XX_RK1(distance, point, method)
1449 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1450 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_XX_RK1
1451 : #endif
1452 : use pm_kind, only: RKC => RK1
1453 : real(RKC) , intent(in) , contiguous :: point(:)
1454 : real(RKC) , intent(out) :: distance
1455 : type(euclidu_type) , intent(in) :: method
1456 : end subroutine
1457 : #endif
1458 :
1459 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1460 :
1461 : #if RK5_ENABLED
1462 : PURE module subroutine setDE_MEU_D2_XX_RK5(distance, point, method)
1463 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1464 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_XX_RK5
1465 : #endif
1466 : use pm_kind, only: RKC => RK5
1467 : real(RKC) , intent(in) , contiguous :: point(:,:)
1468 : real(RKC) , intent(out) , contiguous :: distance(:)
1469 : type(euclidu_type) , intent(in) :: method
1470 : end subroutine
1471 : #endif
1472 :
1473 : #if RK4_ENABLED
1474 : PURE module subroutine setDE_MEU_D2_XX_RK4(distance, point, method)
1475 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1476 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_XX_RK4
1477 : #endif
1478 : use pm_kind, only: RKC => RK4
1479 : real(RKC) , intent(in) , contiguous :: point(:,:)
1480 : real(RKC) , intent(out) , contiguous :: distance(:)
1481 : type(euclidu_type) , intent(in) :: method
1482 : end subroutine
1483 : #endif
1484 :
1485 : #if RK3_ENABLED
1486 : PURE module subroutine setDE_MEU_D2_XX_RK3(distance, point, method)
1487 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1488 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_XX_RK3
1489 : #endif
1490 : use pm_kind, only: RKC => RK3
1491 : real(RKC) , intent(in) , contiguous :: point(:,:)
1492 : real(RKC) , intent(out) , contiguous :: distance(:)
1493 : type(euclidu_type) , intent(in) :: method
1494 : end subroutine
1495 : #endif
1496 :
1497 : #if RK2_ENABLED
1498 : PURE module subroutine setDE_MEU_D2_XX_RK2(distance, point, method)
1499 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1500 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_XX_RK2
1501 : #endif
1502 : use pm_kind, only: RKC => RK2
1503 : real(RKC) , intent(in) , contiguous :: point(:,:)
1504 : real(RKC) , intent(out) , contiguous :: distance(:)
1505 : type(euclidu_type) , intent(in) :: method
1506 : end subroutine
1507 : #endif
1508 :
1509 : #if RK1_ENABLED
1510 : PURE module subroutine setDE_MEU_D2_XX_RK1(distance, point, method)
1511 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1512 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_XX_RK1
1513 : #endif
1514 : use pm_kind, only: RKC => RK1
1515 : real(RKC) , intent(in) , contiguous :: point(:,:)
1516 : real(RKC) , intent(out) , contiguous :: distance(:)
1517 : type(euclidu_type) , intent(in) :: method
1518 : end subroutine
1519 : #endif
1520 :
1521 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1522 :
1523 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1524 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1525 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1526 :
1527 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1528 :
1529 : #if RK5_ENABLED
1530 : PURE module subroutine setDE_MEU_D1_D1_RK5(distance, point, ref, method)
1531 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1532 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D1_RK5
1533 : #endif
1534 : use pm_kind, only: RKC => RK5
1535 : real(RKC) , intent(in) , contiguous :: ref(:)
1536 : real(RKC) , intent(in) , contiguous :: point(:)
1537 : real(RKC) , intent(out) :: distance
1538 : type(euclidu_type) , intent(in) :: method
1539 : end subroutine
1540 : #endif
1541 :
1542 : #if RK4_ENABLED
1543 : PURE module subroutine setDE_MEU_D1_D1_RK4(distance, point, ref, method)
1544 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1545 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D1_RK4
1546 : #endif
1547 : use pm_kind, only: RKC => RK4
1548 : real(RKC) , intent(in) , contiguous :: ref(:)
1549 : real(RKC) , intent(in) , contiguous :: point(:)
1550 : real(RKC) , intent(out) :: distance
1551 : type(euclidu_type) , intent(in) :: method
1552 : end subroutine
1553 : #endif
1554 :
1555 : #if RK3_ENABLED
1556 : PURE module subroutine setDE_MEU_D1_D1_RK3(distance, point, ref, method)
1557 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1558 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D1_RK3
1559 : #endif
1560 : use pm_kind, only: RKC => RK3
1561 : real(RKC) , intent(in) , contiguous :: ref(:)
1562 : real(RKC) , intent(in) , contiguous :: point(:)
1563 : real(RKC) , intent(out) :: distance
1564 : type(euclidu_type) , intent(in) :: method
1565 : end subroutine
1566 : #endif
1567 :
1568 : #if RK2_ENABLED
1569 : PURE module subroutine setDE_MEU_D1_D1_RK2(distance, point, ref, method)
1570 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1571 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D1_RK2
1572 : #endif
1573 : use pm_kind, only: RKC => RK2
1574 : real(RKC) , intent(in) , contiguous :: ref(:)
1575 : real(RKC) , intent(in) , contiguous :: point(:)
1576 : real(RKC) , intent(out) :: distance
1577 : type(euclidu_type) , intent(in) :: method
1578 : end subroutine
1579 : #endif
1580 :
1581 : #if RK1_ENABLED
1582 : PURE module subroutine setDE_MEU_D1_D1_RK1(distance, point, ref, method)
1583 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1584 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D1_RK1
1585 : #endif
1586 : use pm_kind, only: RKC => RK1
1587 : real(RKC) , intent(in) , contiguous :: ref(:)
1588 : real(RKC) , intent(in) , contiguous :: point(:)
1589 : real(RKC) , intent(out) :: distance
1590 : type(euclidu_type) , intent(in) :: method
1591 : end subroutine
1592 : #endif
1593 :
1594 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1595 :
1596 : #if RK5_ENABLED
1597 : PURE module subroutine setDE_MEU_D1_D2_RK5(distance, point, ref, method)
1598 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1599 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D2_RK5
1600 : #endif
1601 : use pm_kind, only: RKC => RK5
1602 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1603 : real(RKC) , intent(in) , contiguous :: point(:)
1604 : real(RKC) , intent(out) , contiguous :: distance(:)
1605 : type(euclidu_type) , intent(in) :: method
1606 : end subroutine
1607 : #endif
1608 :
1609 : #if RK4_ENABLED
1610 : PURE module subroutine setDE_MEU_D1_D2_RK4(distance, point, ref, method)
1611 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1612 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D2_RK4
1613 : #endif
1614 : use pm_kind, only: RKC => RK4
1615 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1616 : real(RKC) , intent(in) , contiguous :: point(:)
1617 : real(RKC) , intent(out) , contiguous :: distance(:)
1618 : type(euclidu_type) , intent(in) :: method
1619 : end subroutine
1620 : #endif
1621 :
1622 : #if RK3_ENABLED
1623 : PURE module subroutine setDE_MEU_D1_D2_RK3(distance, point, ref, method)
1624 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1625 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D2_RK3
1626 : #endif
1627 : use pm_kind, only: RKC => RK3
1628 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1629 : real(RKC) , intent(in) , contiguous :: point(:)
1630 : real(RKC) , intent(out) , contiguous :: distance(:)
1631 : type(euclidu_type) , intent(in) :: method
1632 : end subroutine
1633 : #endif
1634 :
1635 : #if RK2_ENABLED
1636 : PURE module subroutine setDE_MEU_D1_D2_RK2(distance, point, ref, method)
1637 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1638 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D2_RK2
1639 : #endif
1640 : use pm_kind, only: RKC => RK2
1641 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1642 : real(RKC) , intent(in) , contiguous :: point(:)
1643 : real(RKC) , intent(out) , contiguous :: distance(:)
1644 : type(euclidu_type) , intent(in) :: method
1645 : end subroutine
1646 : #endif
1647 :
1648 : #if RK1_ENABLED
1649 : PURE module subroutine setDE_MEU_D1_D2_RK1(distance, point, ref, method)
1650 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1651 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D1_D2_RK1
1652 : #endif
1653 : use pm_kind, only: RKC => RK1
1654 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1655 : real(RKC) , intent(in) , contiguous :: point(:)
1656 : real(RKC) , intent(out) , contiguous :: distance(:)
1657 : type(euclidu_type) , intent(in) :: method
1658 : end subroutine
1659 : #endif
1660 :
1661 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1662 :
1663 : #if RK5_ENABLED
1664 : PURE module subroutine setDE_MEU_D2_D1_RK5(distance, point, ref, method)
1665 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1666 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D1_RK5
1667 : #endif
1668 : use pm_kind, only: RKC => RK5
1669 : real(RKC) , intent(in) , contiguous :: ref(:)
1670 : real(RKC) , intent(in) , contiguous :: point(:,:)
1671 : real(RKC) , intent(out) , contiguous :: distance(:)
1672 : type(euclidu_type) , intent(in) :: method
1673 : end subroutine
1674 : #endif
1675 :
1676 : #if RK4_ENABLED
1677 : PURE module subroutine setDE_MEU_D2_D1_RK4(distance, point, ref, method)
1678 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1679 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D1_RK4
1680 : #endif
1681 : use pm_kind, only: RKC => RK4
1682 : real(RKC) , intent(in) , contiguous :: ref(:)
1683 : real(RKC) , intent(in) , contiguous :: point(:,:)
1684 : real(RKC) , intent(out) , contiguous :: distance(:)
1685 : type(euclidu_type) , intent(in) :: method
1686 : end subroutine
1687 : #endif
1688 :
1689 : #if RK3_ENABLED
1690 : PURE module subroutine setDE_MEU_D2_D1_RK3(distance, point, ref, method)
1691 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1692 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D1_RK3
1693 : #endif
1694 : use pm_kind, only: RKC => RK3
1695 : real(RKC) , intent(in) , contiguous :: ref(:)
1696 : real(RKC) , intent(in) , contiguous :: point(:,:)
1697 : real(RKC) , intent(out) , contiguous :: distance(:)
1698 : type(euclidu_type) , intent(in) :: method
1699 : end subroutine
1700 : #endif
1701 :
1702 : #if RK2_ENABLED
1703 : PURE module subroutine setDE_MEU_D2_D1_RK2(distance, point, ref, method)
1704 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1705 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D1_RK2
1706 : #endif
1707 : use pm_kind, only: RKC => RK2
1708 : real(RKC) , intent(in) , contiguous :: ref(:)
1709 : real(RKC) , intent(in) , contiguous :: point(:,:)
1710 : real(RKC) , intent(out) , contiguous :: distance(:)
1711 : type(euclidu_type) , intent(in) :: method
1712 : end subroutine
1713 : #endif
1714 :
1715 : #if RK1_ENABLED
1716 : PURE module subroutine setDE_MEU_D2_D1_RK1(distance, point, ref, method)
1717 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1718 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D1_RK1
1719 : #endif
1720 : use pm_kind, only: RKC => RK1
1721 : real(RKC) , intent(in) , contiguous :: ref(:)
1722 : real(RKC) , intent(in) , contiguous :: point(:,:)
1723 : real(RKC) , intent(out) , contiguous :: distance(:)
1724 : type(euclidu_type) , intent(in) :: method
1725 : end subroutine
1726 : #endif
1727 :
1728 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1729 :
1730 : #if RK5_ENABLED
1731 : PURE module subroutine setDE_MEU_D2_D2_RK5(distance, point, ref, method)
1732 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1733 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D2_RK5
1734 : #endif
1735 : use pm_kind, only: RKC => RK5
1736 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1737 : real(RKC) , intent(in) , contiguous :: point(:,:)
1738 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1739 : type(euclidu_type) , intent(in) :: method
1740 : end subroutine
1741 : #endif
1742 :
1743 : #if RK4_ENABLED
1744 : PURE module subroutine setDE_MEU_D2_D2_RK4(distance, point, ref, method)
1745 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1746 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D2_RK4
1747 : #endif
1748 : use pm_kind, only: RKC => RK4
1749 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1750 : real(RKC) , intent(in) , contiguous :: point(:,:)
1751 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1752 : type(euclidu_type) , intent(in) :: method
1753 : end subroutine
1754 : #endif
1755 :
1756 : #if RK3_ENABLED
1757 : PURE module subroutine setDE_MEU_D2_D2_RK3(distance, point, ref, method)
1758 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1759 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D2_RK3
1760 : #endif
1761 : use pm_kind, only: RKC => RK3
1762 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1763 : real(RKC) , intent(in) , contiguous :: point(:,:)
1764 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1765 : type(euclidu_type) , intent(in) :: method
1766 : end subroutine
1767 : #endif
1768 :
1769 : #if RK2_ENABLED
1770 : PURE module subroutine setDE_MEU_D2_D2_RK2(distance, point, ref, method)
1771 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1772 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D2_RK2
1773 : #endif
1774 : use pm_kind, only: RKC => RK2
1775 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1776 : real(RKC) , intent(in) , contiguous :: point(:,:)
1777 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1778 : type(euclidu_type) , intent(in) :: method
1779 : end subroutine
1780 : #endif
1781 :
1782 : #if RK1_ENABLED
1783 : PURE module subroutine setDE_MEU_D2_D2_RK1(distance, point, ref, method)
1784 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1785 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEU_D2_D2_RK1
1786 : #endif
1787 : use pm_kind, only: RKC => RK1
1788 : real(RKC) , intent(in) , contiguous :: ref(:,:)
1789 : real(RKC) , intent(in) , contiguous :: point(:,:)
1790 : real(RKC) , intent(out) , contiguous :: distance(:,:)
1791 : type(euclidu_type) , intent(in) :: method
1792 : end subroutine
1793 : #endif
1794 :
1795 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1796 :
1797 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1798 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1799 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1800 :
1801 : end interface
1802 :
1803 : ! euclidsq
1804 :
1805 : interface setDisEuclid
1806 :
1807 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1808 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1809 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1810 :
1811 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1812 :
1813 : #if RK5_ENABLED
1814 : PURE module subroutine setDE_MEQ_D1_XX_RK5(distance, point, method)
1815 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1816 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_XX_RK5
1817 : #endif
1818 : use pm_kind, only: RKC => RK5
1819 : real(RKC) , intent(in) , contiguous :: point(:)
1820 : real(RKC) , intent(out) :: distance
1821 : type(euclidsq_type) , intent(in) :: method
1822 : end subroutine
1823 : #endif
1824 :
1825 : #if RK4_ENABLED
1826 : PURE module subroutine setDE_MEQ_D1_XX_RK4(distance, point, method)
1827 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1828 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_XX_RK4
1829 : #endif
1830 : use pm_kind, only: RKC => RK4
1831 : real(RKC) , intent(in) , contiguous :: point(:)
1832 : real(RKC) , intent(out) :: distance
1833 : type(euclidsq_type) , intent(in) :: method
1834 : end subroutine
1835 : #endif
1836 :
1837 : #if RK3_ENABLED
1838 : PURE module subroutine setDE_MEQ_D1_XX_RK3(distance, point, method)
1839 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1840 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_XX_RK3
1841 : #endif
1842 : use pm_kind, only: RKC => RK3
1843 : real(RKC) , intent(in) , contiguous :: point(:)
1844 : real(RKC) , intent(out) :: distance
1845 : type(euclidsq_type) , intent(in) :: method
1846 : end subroutine
1847 : #endif
1848 :
1849 : #if RK2_ENABLED
1850 : PURE module subroutine setDE_MEQ_D1_XX_RK2(distance, point, method)
1851 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1852 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_XX_RK2
1853 : #endif
1854 : use pm_kind, only: RKC => RK2
1855 : real(RKC) , intent(in) , contiguous :: point(:)
1856 : real(RKC) , intent(out) :: distance
1857 : type(euclidsq_type) , intent(in) :: method
1858 : end subroutine
1859 : #endif
1860 :
1861 : #if RK1_ENABLED
1862 : PURE module subroutine setDE_MEQ_D1_XX_RK1(distance, point, method)
1863 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1864 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_XX_RK1
1865 : #endif
1866 : use pm_kind, only: RKC => RK1
1867 : real(RKC) , intent(in) , contiguous :: point(:)
1868 : real(RKC) , intent(out) :: distance
1869 : type(euclidsq_type) , intent(in) :: method
1870 : end subroutine
1871 : #endif
1872 :
1873 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1874 :
1875 : #if RK5_ENABLED
1876 : PURE module subroutine setDE_MEQ_D2_XX_RK5(distance, point, method)
1877 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1878 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_XX_RK5
1879 : #endif
1880 : use pm_kind, only: RKC => RK5
1881 : real(RKC) , intent(in) , contiguous :: point(:,:)
1882 : real(RKC) , intent(out) , contiguous :: distance(:)
1883 : type(euclidsq_type) , intent(in) :: method
1884 : end subroutine
1885 : #endif
1886 :
1887 : #if RK4_ENABLED
1888 : PURE module subroutine setDE_MEQ_D2_XX_RK4(distance, point, method)
1889 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1890 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_XX_RK4
1891 : #endif
1892 : use pm_kind, only: RKC => RK4
1893 : real(RKC) , intent(in) , contiguous :: point(:,:)
1894 : real(RKC) , intent(out) , contiguous :: distance(:)
1895 : type(euclidsq_type) , intent(in) :: method
1896 : end subroutine
1897 : #endif
1898 :
1899 : #if RK3_ENABLED
1900 : PURE module subroutine setDE_MEQ_D2_XX_RK3(distance, point, method)
1901 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1902 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_XX_RK3
1903 : #endif
1904 : use pm_kind, only: RKC => RK3
1905 : real(RKC) , intent(in) , contiguous :: point(:,:)
1906 : real(RKC) , intent(out) , contiguous :: distance(:)
1907 : type(euclidsq_type) , intent(in) :: method
1908 : end subroutine
1909 : #endif
1910 :
1911 : #if RK2_ENABLED
1912 : PURE module subroutine setDE_MEQ_D2_XX_RK2(distance, point, method)
1913 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1914 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_XX_RK2
1915 : #endif
1916 : use pm_kind, only: RKC => RK2
1917 : real(RKC) , intent(in) , contiguous :: point(:,:)
1918 : real(RKC) , intent(out) , contiguous :: distance(:)
1919 : type(euclidsq_type) , intent(in) :: method
1920 : end subroutine
1921 : #endif
1922 :
1923 : #if RK1_ENABLED
1924 : PURE module subroutine setDE_MEQ_D2_XX_RK1(distance, point, method)
1925 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1926 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_XX_RK1
1927 : #endif
1928 : use pm_kind, only: RKC => RK1
1929 : real(RKC) , intent(in) , contiguous :: point(:,:)
1930 : real(RKC) , intent(out) , contiguous :: distance(:)
1931 : type(euclidsq_type) , intent(in) :: method
1932 : end subroutine
1933 : #endif
1934 :
1935 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1936 :
1937 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1938 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1939 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1940 :
1941 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1942 :
1943 : #if RK5_ENABLED
1944 : PURE module subroutine setDE_MEQ_D1_D1_RK5(distance, point, ref, method)
1945 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1946 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D1_RK5
1947 : #endif
1948 : use pm_kind, only: RKC => RK5
1949 : real(RKC) , intent(in) , contiguous :: ref(:)
1950 : real(RKC) , intent(in) , contiguous :: point(:)
1951 : real(RKC) , intent(out) :: distance
1952 : type(euclidsq_type) , intent(in) :: method
1953 : end subroutine
1954 : #endif
1955 :
1956 : #if RK4_ENABLED
1957 : PURE module subroutine setDE_MEQ_D1_D1_RK4(distance, point, ref, method)
1958 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1959 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D1_RK4
1960 : #endif
1961 : use pm_kind, only: RKC => RK4
1962 : real(RKC) , intent(in) , contiguous :: ref(:)
1963 : real(RKC) , intent(in) , contiguous :: point(:)
1964 : real(RKC) , intent(out) :: distance
1965 : type(euclidsq_type) , intent(in) :: method
1966 : end subroutine
1967 : #endif
1968 :
1969 : #if RK3_ENABLED
1970 : PURE module subroutine setDE_MEQ_D1_D1_RK3(distance, point, ref, method)
1971 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1972 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D1_RK3
1973 : #endif
1974 : use pm_kind, only: RKC => RK3
1975 : real(RKC) , intent(in) , contiguous :: ref(:)
1976 : real(RKC) , intent(in) , contiguous :: point(:)
1977 : real(RKC) , intent(out) :: distance
1978 : type(euclidsq_type) , intent(in) :: method
1979 : end subroutine
1980 : #endif
1981 :
1982 : #if RK2_ENABLED
1983 : PURE module subroutine setDE_MEQ_D1_D1_RK2(distance, point, ref, method)
1984 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1985 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D1_RK2
1986 : #endif
1987 : use pm_kind, only: RKC => RK2
1988 : real(RKC) , intent(in) , contiguous :: ref(:)
1989 : real(RKC) , intent(in) , contiguous :: point(:)
1990 : real(RKC) , intent(out) :: distance
1991 : type(euclidsq_type) , intent(in) :: method
1992 : end subroutine
1993 : #endif
1994 :
1995 : #if RK1_ENABLED
1996 : PURE module subroutine setDE_MEQ_D1_D1_RK1(distance, point, ref, method)
1997 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1998 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D1_RK1
1999 : #endif
2000 : use pm_kind, only: RKC => RK1
2001 : real(RKC) , intent(in) , contiguous :: ref(:)
2002 : real(RKC) , intent(in) , contiguous :: point(:)
2003 : real(RKC) , intent(out) :: distance
2004 : type(euclidsq_type) , intent(in) :: method
2005 : end subroutine
2006 : #endif
2007 :
2008 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2009 :
2010 : #if RK5_ENABLED
2011 : PURE module subroutine setDE_MEQ_D1_D2_RK5(distance, point, ref, method)
2012 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2013 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D2_RK5
2014 : #endif
2015 : use pm_kind, only: RKC => RK5
2016 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2017 : real(RKC) , intent(in) , contiguous :: point(:)
2018 : real(RKC) , intent(out) , contiguous :: distance(:)
2019 : type(euclidsq_type) , intent(in) :: method
2020 : end subroutine
2021 : #endif
2022 :
2023 : #if RK4_ENABLED
2024 : PURE module subroutine setDE_MEQ_D1_D2_RK4(distance, point, ref, method)
2025 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2026 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D2_RK4
2027 : #endif
2028 : use pm_kind, only: RKC => RK4
2029 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2030 : real(RKC) , intent(in) , contiguous :: point(:)
2031 : real(RKC) , intent(out) , contiguous :: distance(:)
2032 : type(euclidsq_type) , intent(in) :: method
2033 : end subroutine
2034 : #endif
2035 :
2036 : #if RK3_ENABLED
2037 : PURE module subroutine setDE_MEQ_D1_D2_RK3(distance, point, ref, method)
2038 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2039 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D2_RK3
2040 : #endif
2041 : use pm_kind, only: RKC => RK3
2042 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2043 : real(RKC) , intent(in) , contiguous :: point(:)
2044 : real(RKC) , intent(out) , contiguous :: distance(:)
2045 : type(euclidsq_type) , intent(in) :: method
2046 : end subroutine
2047 : #endif
2048 :
2049 : #if RK2_ENABLED
2050 : PURE module subroutine setDE_MEQ_D1_D2_RK2(distance, point, ref, method)
2051 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2052 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D2_RK2
2053 : #endif
2054 : use pm_kind, only: RKC => RK2
2055 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2056 : real(RKC) , intent(in) , contiguous :: point(:)
2057 : real(RKC) , intent(out) , contiguous :: distance(:)
2058 : type(euclidsq_type) , intent(in) :: method
2059 : end subroutine
2060 : #endif
2061 :
2062 : #if RK1_ENABLED
2063 : PURE module subroutine setDE_MEQ_D1_D2_RK1(distance, point, ref, method)
2064 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2065 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D1_D2_RK1
2066 : #endif
2067 : use pm_kind, only: RKC => RK1
2068 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2069 : real(RKC) , intent(in) , contiguous :: point(:)
2070 : real(RKC) , intent(out) , contiguous :: distance(:)
2071 : type(euclidsq_type) , intent(in) :: method
2072 : end subroutine
2073 : #endif
2074 :
2075 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2076 :
2077 : #if RK5_ENABLED
2078 : PURE module subroutine setDE_MEQ_D2_D1_RK5(distance, point, ref, method)
2079 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2080 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D1_RK5
2081 : #endif
2082 : use pm_kind, only: RKC => RK5
2083 : real(RKC) , intent(in) , contiguous :: ref(:)
2084 : real(RKC) , intent(in) , contiguous :: point(:,:)
2085 : real(RKC) , intent(out) , contiguous :: distance(:)
2086 : type(euclidsq_type) , intent(in) :: method
2087 : end subroutine
2088 : #endif
2089 :
2090 : #if RK4_ENABLED
2091 : PURE module subroutine setDE_MEQ_D2_D1_RK4(distance, point, ref, method)
2092 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2093 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D1_RK4
2094 : #endif
2095 : use pm_kind, only: RKC => RK4
2096 : real(RKC) , intent(in) , contiguous :: ref(:)
2097 : real(RKC) , intent(in) , contiguous :: point(:,:)
2098 : real(RKC) , intent(out) , contiguous :: distance(:)
2099 : type(euclidsq_type) , intent(in) :: method
2100 : end subroutine
2101 : #endif
2102 :
2103 : #if RK3_ENABLED
2104 : PURE module subroutine setDE_MEQ_D2_D1_RK3(distance, point, ref, method)
2105 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2106 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D1_RK3
2107 : #endif
2108 : use pm_kind, only: RKC => RK3
2109 : real(RKC) , intent(in) , contiguous :: ref(:)
2110 : real(RKC) , intent(in) , contiguous :: point(:,:)
2111 : real(RKC) , intent(out) , contiguous :: distance(:)
2112 : type(euclidsq_type) , intent(in) :: method
2113 : end subroutine
2114 : #endif
2115 :
2116 : #if RK2_ENABLED
2117 : PURE module subroutine setDE_MEQ_D2_D1_RK2(distance, point, ref, method)
2118 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2119 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D1_RK2
2120 : #endif
2121 : use pm_kind, only: RKC => RK2
2122 : real(RKC) , intent(in) , contiguous :: ref(:)
2123 : real(RKC) , intent(in) , contiguous :: point(:,:)
2124 : real(RKC) , intent(out) , contiguous :: distance(:)
2125 : type(euclidsq_type) , intent(in) :: method
2126 : end subroutine
2127 : #endif
2128 :
2129 : #if RK1_ENABLED
2130 : PURE module subroutine setDE_MEQ_D2_D1_RK1(distance, point, ref, method)
2131 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2132 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D1_RK1
2133 : #endif
2134 : use pm_kind, only: RKC => RK1
2135 : real(RKC) , intent(in) , contiguous :: ref(:)
2136 : real(RKC) , intent(in) , contiguous :: point(:,:)
2137 : real(RKC) , intent(out) , contiguous :: distance(:)
2138 : type(euclidsq_type) , intent(in) :: method
2139 : end subroutine
2140 : #endif
2141 :
2142 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2143 :
2144 : #if RK5_ENABLED
2145 : PURE module subroutine setDE_MEQ_D2_D2_RK5(distance, point, ref, method)
2146 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2147 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D2_RK5
2148 : #endif
2149 : use pm_kind, only: RKC => RK5
2150 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2151 : real(RKC) , intent(in) , contiguous :: point(:,:)
2152 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2153 : type(euclidsq_type) , intent(in) :: method
2154 : end subroutine
2155 : #endif
2156 :
2157 : #if RK4_ENABLED
2158 : PURE module subroutine setDE_MEQ_D2_D2_RK4(distance, point, ref, method)
2159 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2160 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D2_RK4
2161 : #endif
2162 : use pm_kind, only: RKC => RK4
2163 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2164 : real(RKC) , intent(in) , contiguous :: point(:,:)
2165 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2166 : type(euclidsq_type) , intent(in) :: method
2167 : end subroutine
2168 : #endif
2169 :
2170 : #if RK3_ENABLED
2171 : PURE module subroutine setDE_MEQ_D2_D2_RK3(distance, point, ref, method)
2172 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2173 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D2_RK3
2174 : #endif
2175 : use pm_kind, only: RKC => RK3
2176 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2177 : real(RKC) , intent(in) , contiguous :: point(:,:)
2178 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2179 : type(euclidsq_type) , intent(in) :: method
2180 : end subroutine
2181 : #endif
2182 :
2183 : #if RK2_ENABLED
2184 : PURE module subroutine setDE_MEQ_D2_D2_RK2(distance, point, ref, method)
2185 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2186 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D2_RK2
2187 : #endif
2188 : use pm_kind, only: RKC => RK2
2189 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2190 : real(RKC) , intent(in) , contiguous :: point(:,:)
2191 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2192 : type(euclidsq_type) , intent(in) :: method
2193 : end subroutine
2194 : #endif
2195 :
2196 : #if RK1_ENABLED
2197 : PURE module subroutine setDE_MEQ_D2_D2_RK1(distance, point, ref, method)
2198 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2199 : !DEC$ ATTRIBUTES DLLEXPORT :: setDE_MEQ_D2_D2_RK1
2200 : #endif
2201 : use pm_kind, only: RKC => RK1
2202 : real(RKC) , intent(in) , contiguous :: ref(:,:)
2203 : real(RKC) , intent(in) , contiguous :: point(:,:)
2204 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2205 : type(euclidsq_type) , intent(in) :: method
2206 : end subroutine
2207 : #endif
2208 :
2209 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2210 :
2211 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2212 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2213 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2214 :
2215 : end interface
2216 :
2217 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2218 :
2219 : !> \brief
2220 : !> Return the full or a subset of the Euclidean (squared) distance matrix of the input set of `npnt` points in `ndim` dimensions.
2221 : !>
2222 : !> \param[in] pack : The input scalar that can be:
2223 : !> <ol>
2224 : !> <li> the constant [rdpack](@ref pm_matrixPack::rdpack) or an object of type [rdpack_type](@ref pm_matrixPack::rdpack_type),
2225 : !> implying the use of Rectangular Default Packing format for the output matrix.<br>
2226 : !> </ol>
2227 : !> \param[in] subset : The input scalar that can be:
2228 : !> <ol>
2229 : !> <li> the constant [uppLowDia](@ref pm_matrixSubset::uppLowDia) or an object of type [uppLowDia_type](@ref pm_matrixSubset::uppLowDia_type),
2230 : !> indicating that the output `distance` must contain the full distance matrix of shape `(1:npnt, 1:npnt)` including the zero-valued diagonals.<br>
2231 : !> <li> the constant [uppLow](@ref pm_matrixSubset::uppLow) or an object of type [uppLow_type](@ref pm_matrixSubset::uppLow_type),
2232 : !> indicating that the output `distance` must exclude the zero-valued diagonals from the distance matrix yielding a distance matrix of shape `(1:npnt - 1, 1:npnt)`.<br>
2233 : !> **Motivation:** The zero-valued diagonal elements of the distance matrix are are frequently troubling for subsequent vector operations on the output distance matrix.<br>
2234 : !> Such vector operations include but are not limited to finding the extrema of distances, for example, the nearest and farthest neighbors.<br>
2235 : !> This `subset` value offers a fast convenient method of excluding self-distance values from the output distance matrix
2236 : !> such that each column `(1:npnt-1 , i)` of the distance matrix contains only the distances of `point(1:ndim, i)` with all other `npnt - 1` points in `point`.<br>
2237 : !> For example, finding the nearest neighbor of the points using the output distance matrix would be as simple as `minval(distance, 1)`.<br>
2238 : !> Finding the actual index of the point that is the nearest neighbor to each point would be slightly more involved as as two-step process:<br>
2239 : !> \code{.F90}
2240 : !> nn1loc(1 : npnt) = minloc(distance(1 : npnt - 1, 1 : npnt), 1)
2241 : !> nn1loc = merge(nn1loc, nn1loc + 1, getRange(1, npnt) <= nn1loc)
2242 : !> \endcode
2243 : !> where `nn1loc` is the vector of indices of the first nearest neighbors such that `point(:,nn1loc(i))` is the nearest neighbor to `point(:,i)`.<br>
2244 : !> </ol>
2245 : !> \param[in] point : The input `contiguous` matrix of shape `(1:ndim, 1:npnt)` of,
2246 : !> <ol>
2247 : !> <li> type `real` of kind \RKALL,
2248 : !> </ol>
2249 : !> containing `npnt` points in the `ndim`-dimensional Euclidean space
2250 : !> whose distances with respect to each other must be computed and returned.<br>
2251 : !> \param[in] method : The input scalar that can be,<br>
2252 : !> <ol>
2253 : !> <li> the constant [euclid](@ref pm_distanceEuclid::euclid) or an object of type [euclid_type](@ref pm_distanceEuclid::euclid_type),
2254 : !> implying that all distance calculations must be done without undue numerical overflow.<br>
2255 : !> This option is computationally the most expensive method.<br>
2256 : !> <li> the constant [euclidu](@ref pm_distanceEuclid::euclidu) or an object of type [euclidu_type](@ref pm_distanceEuclid::euclidu_type),
2257 : !> implying that all distance calculations must be **without** runtime checks for numerical overflow.<br>
2258 : !> This option is computationally faster than the [euclid](@ref pm_distanceEuclid::euclid) method.<br>
2259 : !> <li> the constant [euclidsq](@ref pm_distanceEuclid::euclidsq) or an object of type [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)
2260 : !> implying that the **squared** values of all distance calculations must be returned **without** runtime checks for numerical overflow.<br>
2261 : !> This option is computationally the fastest approach to constructing the distance matrix because it avoid costly `sqrt()` operations and runtime overflow checks.<br>
2262 : !> </ol>
2263 : !> (**optional**, default = [euclid](@ref pm_distanceEuclid::euclid))
2264 : !>
2265 : !> \return
2266 : !> `distance` : The output `contiguous` array of rank `2` of the same type and kind as the input argument `point`.<br>
2267 : !> On output, it contains the requested `subset` of the (squared) distance matrix in the specified packing format `pack`.<br>
2268 : !> Any element of `distance` that is not included in the specified `subset` will remain intact, if any such element exists.<br>
2269 : !>
2270 : !> \interface{getDisMatEuclid}
2271 : !> \code{.F90}
2272 : !>
2273 : !> use pm_distanceEuclid, only: getDisMatEuclid
2274 : !>
2275 : !> distance(1:npnt, 1:npnt) = getDisMatEuclid(pack, subset, point(1:ndim, 1:npnt), method) ! subset = uppLowDia, pack = rdpack
2276 : !> distance(1:npnt-1, 1:npnt) = getDisMatEuclid(pack, subset, point(1:ndim, 1:npnt), method) ! subset = uppLow, pack = rdpack
2277 : !> !
2278 : !> \endcode
2279 : !>
2280 : !> \warning
2281 : !> The condition `size(point, 1) == size(point, 2)` must hold for the corresponding input arguments.<br>
2282 : !> The condition `shape(distance) == [size(point, 1), size(point, 1)] .or. .not. same_type_as(subset, uppLowDia)` must hold for the corresponding input arguments.<br>
2283 : !> The condition `shape(distance) == [size(point, 1) - 1, size(point, 1)] .or. .not. same_type_as(subset, uppLow)` must hold for the corresponding input arguments.<br>
2284 : !> \vericons
2285 : !>
2286 : !> \warnpure
2287 : !>
2288 : !> \devnote
2289 : !> The input arguments `pack, subset` appear first for a good reason:
2290 : !> To allow the possibility of adding of similarly-named arguments for the input `point` matrix.
2291 : !>
2292 : !> \see
2293 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
2294 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
2295 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
2296 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
2297 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
2298 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
2299 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
2300 : !> [setDisEuclid](@ref pm_distanceEuclid::setDisEuclid)<br>
2301 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
2302 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
2303 : !>
2304 : !> \example{getDisMatEuclid}
2305 : !> \include{lineno} example/pm_distanceEuclid/getDisMatEuclid/main.F90
2306 : !> \compilef{getDisMatEuclid}
2307 : !> \output{getDisMatEuclid}
2308 : !> \include{lineno} example/pm_distanceEuclid/getDisMatEuclid/main.out.F90
2309 : !>
2310 : !> \test
2311 : !> [test_pm_distanceEuclid](@ref test_pm_distanceEuclid)
2312 : !>
2313 : !> \todo
2314 : !> \phigh
2315 : !> This generic interface must be extended to allow other packing and subsets of the output distance matrix.
2316 : !>
2317 : !> \finmain{getDisMatEuclid}
2318 : !>
2319 : !> \author
2320 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
2321 :
2322 : ! rdpack
2323 :
2324 : interface getDisMatEuclid
2325 :
2326 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2327 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2328 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2329 :
2330 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2331 :
2332 : #if RK5_ENABLED
2333 : PURE module function getDME_RDP_FUL_RK5(point, method) result(distance)
2334 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2335 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_FUL_RK5
2336 : #endif
2337 : use pm_kind, only: RKC => RK5
2338 : real(RKC) , intent(in) , contiguous :: point(:,:)
2339 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2340 : class(*) , intent(in) , optional :: method
2341 : end function
2342 : #endif
2343 :
2344 : #if RK4_ENABLED
2345 : PURE module function getDME_RDP_FUL_RK4(point, method) result(distance)
2346 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2347 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_FUL_RK4
2348 : #endif
2349 : use pm_kind, only: RKC => RK4
2350 : real(RKC) , intent(in) , contiguous :: point(:,:)
2351 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2352 : class(*) , intent(in) , optional :: method
2353 : end function
2354 : #endif
2355 :
2356 : #if RK3_ENABLED
2357 : PURE module function getDME_RDP_FUL_RK3(point, method) result(distance)
2358 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2359 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_FUL_RK3
2360 : #endif
2361 : use pm_kind, only: RKC => RK3
2362 : real(RKC) , intent(in) , contiguous :: point(:,:)
2363 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2364 : class(*) , intent(in) , optional :: method
2365 : end function
2366 : #endif
2367 :
2368 : #if RK2_ENABLED
2369 : PURE module function getDME_RDP_FUL_RK2(point, method) result(distance)
2370 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2371 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_FUL_RK2
2372 : #endif
2373 : use pm_kind, only: RKC => RK2
2374 : real(RKC) , intent(in) , contiguous :: point(:,:)
2375 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2376 : class(*) , intent(in) , optional :: method
2377 : end function
2378 : #endif
2379 :
2380 : #if RK1_ENABLED
2381 : PURE module function getDME_RDP_FUL_RK1(point, method) result(distance)
2382 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2383 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_FUL_RK1
2384 : #endif
2385 : use pm_kind, only: RKC => RK1
2386 : real(RKC) , intent(in) , contiguous :: point(:,:)
2387 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2388 : class(*) , intent(in) , optional :: method
2389 : end function
2390 : #endif
2391 :
2392 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2393 :
2394 : #if RK5_ENABLED
2395 : PURE module function getDME_RDP_ULD_RK5(pack, subset, point, method) result(distance)
2396 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2397 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULD_RK5
2398 : #endif
2399 : use pm_kind, only: RKC => RK5
2400 : real(RKC) , intent(in) , contiguous :: point(:,:)
2401 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2402 : class(*) , intent(in) , optional :: method
2403 : type(uppLowDia_type), intent(in) :: subset
2404 : type(rdpack_type) , intent(in) :: pack
2405 : end function
2406 : #endif
2407 :
2408 : #if RK4_ENABLED
2409 : PURE module function getDME_RDP_ULD_RK4(pack, subset, point, method) result(distance)
2410 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2411 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULD_RK4
2412 : #endif
2413 : use pm_kind, only: RKC => RK4
2414 : real(RKC) , intent(in) , contiguous :: point(:,:)
2415 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2416 : class(*) , intent(in) , optional :: method
2417 : type(uppLowDia_type), intent(in) :: subset
2418 : type(rdpack_type) , intent(in) :: pack
2419 : end function
2420 : #endif
2421 :
2422 : #if RK3_ENABLED
2423 : PURE module function getDME_RDP_ULD_RK3(pack, subset, point, method) result(distance)
2424 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2425 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULD_RK3
2426 : #endif
2427 : use pm_kind, only: RKC => RK3
2428 : real(RKC) , intent(in) , contiguous :: point(:,:)
2429 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2430 : class(*) , intent(in) , optional :: method
2431 : type(uppLowDia_type), intent(in) :: subset
2432 : type(rdpack_type) , intent(in) :: pack
2433 : end function
2434 : #endif
2435 :
2436 : #if RK2_ENABLED
2437 : PURE module function getDME_RDP_ULD_RK2(pack, subset, point, method) result(distance)
2438 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2439 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULD_RK2
2440 : #endif
2441 : use pm_kind, only: RKC => RK2
2442 : real(RKC) , intent(in) , contiguous :: point(:,:)
2443 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2444 : class(*) , intent(in) , optional :: method
2445 : type(uppLowDia_type), intent(in) :: subset
2446 : type(rdpack_type) , intent(in) :: pack
2447 : end function
2448 : #endif
2449 :
2450 : #if RK1_ENABLED
2451 : PURE module function getDME_RDP_ULD_RK1(pack, subset, point, method) result(distance)
2452 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2453 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULD_RK1
2454 : #endif
2455 : use pm_kind, only: RKC => RK1
2456 : real(RKC) , intent(in) , contiguous :: point(:,:)
2457 : real(RKC) :: distance(size(point, 2, IK), size(point, 2, IK))
2458 : class(*) , intent(in) , optional :: method
2459 : type(uppLowDia_type), intent(in) :: subset
2460 : type(rdpack_type) , intent(in) :: pack
2461 : end function
2462 : #endif
2463 :
2464 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2465 :
2466 : #if RK5_ENABLED
2467 : PURE module function getDME_RDP_ULX_RK5(pack, subset, point, method) result(distance)
2468 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2469 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULX_RK5
2470 : #endif
2471 : use pm_kind, only: RKC => RK5
2472 : real(RKC) , intent(in) , contiguous :: point(:,:)
2473 : real(RKC) :: distance(size(point, 2, IK) - 1, size(point, 2, IK))
2474 : class(*) , intent(in) , optional :: method
2475 : type(uppLow_type) , intent(in) :: subset
2476 : type(rdpack_type) , intent(in) :: pack
2477 : end function
2478 : #endif
2479 :
2480 : #if RK4_ENABLED
2481 : PURE module function getDME_RDP_ULX_RK4(pack, subset, point, method) result(distance)
2482 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2483 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULX_RK4
2484 : #endif
2485 : use pm_kind, only: RKC => RK4
2486 : real(RKC) , intent(in) , contiguous :: point(:,:)
2487 : real(RKC) :: distance(size(point, 2, IK) - 1, size(point, 2, IK))
2488 : class(*) , intent(in) , optional :: method
2489 : type(uppLow_type) , intent(in) :: subset
2490 : type(rdpack_type) , intent(in) :: pack
2491 : end function
2492 : #endif
2493 :
2494 : #if RK3_ENABLED
2495 : PURE module function getDME_RDP_ULX_RK3(pack, subset, point, method) result(distance)
2496 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2497 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULX_RK3
2498 : #endif
2499 : use pm_kind, only: RKC => RK3
2500 : real(RKC) , intent(in) , contiguous :: point(:,:)
2501 : real(RKC) :: distance(size(point, 2, IK) - 1, size(point, 2, IK))
2502 : class(*) , intent(in) , optional :: method
2503 : type(uppLow_type) , intent(in) :: subset
2504 : type(rdpack_type) , intent(in) :: pack
2505 : end function
2506 : #endif
2507 :
2508 : #if RK2_ENABLED
2509 : PURE module function getDME_RDP_ULX_RK2(pack, subset, point, method) result(distance)
2510 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2511 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULX_RK2
2512 : #endif
2513 : use pm_kind, only: RKC => RK2
2514 : real(RKC) , intent(in) , contiguous :: point(:,:)
2515 : real(RKC) :: distance(size(point, 2, IK) - 1, size(point, 2, IK))
2516 : class(*) , intent(in) , optional :: method
2517 : type(uppLow_type) , intent(in) :: subset
2518 : type(rdpack_type) , intent(in) :: pack
2519 : end function
2520 : #endif
2521 :
2522 : #if RK1_ENABLED
2523 : PURE module function getDME_RDP_ULX_RK1(pack, subset, point, method) result(distance)
2524 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2525 : !DEC$ ATTRIBUTES DLLEXPORT :: getDME_RDP_ULX_RK1
2526 : #endif
2527 : use pm_kind, only: RKC => RK1
2528 : real(RKC) , intent(in) , contiguous :: point(:,:)
2529 : real(RKC) :: distance(size(point, 2, IK) - 1, size(point, 2, IK))
2530 : class(*) , intent(in) , optional :: method
2531 : type(uppLow_type) , intent(in) :: subset
2532 : type(rdpack_type) , intent(in) :: pack
2533 : end function
2534 : #endif
2535 :
2536 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2537 :
2538 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2539 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2540 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2541 :
2542 : end interface
2543 :
2544 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2545 :
2546 : !> \brief
2547 : !> Return the full or a subset of the Euclidean (squared) distance matrix of the input set of `npnt` points in `ndim` dimensions.
2548 : !>
2549 : !> \param[inout] distance : The input/output `contiguous` array of rank `2` of the same type and kind as the input argument `point`.<br>
2550 : !> On output, it contains the requested `subset` of the (squared) distance matrix in the specified packing format `pack`.<br>
2551 : !> Any element of `distance` that is not included in the specified `subset` will remain intact, if any such element exists.<br>
2552 : !> \param[in] pack : The input scalar that can be:
2553 : !> <ol>
2554 : !> <li> the constant [rdpack](@ref pm_matrixPack::rdpack) or an object of type [rdpack_type](@ref pm_matrixPack::rdpack_type),
2555 : !> implying the use of Rectangular Default Packing format for the output matrix.<br>
2556 : ! <li> the constant [lfpack](@ref pm_matrixPack::lfpack) or an object of type [lfpack_type](@ref pm_matrixSubset::lfpack_type),
2557 : ! implying the use of Linear Full Packing format for the output matrix.<br>
2558 : ! This means that the output matrix must be contiguous vector of appropriate size.<br>
2559 : ! On output, `distance` will be a **dense** ([linear contiguous packed](@ref pm_matrixPack::lfpack_type))
2560 : ! vector containing the pairwise distances of the points in `point` from itself,
2561 : ! corresponding to lower triangle of symmetric square matrix of pairwise distances of `point` from itself.<br>
2562 : ! By definition, the diagonal elements of the square distance matrix are zeros and not included in the output dense vector.<br>
2563 : ! The following figure illustrates the storage layout for the dense vector format compared to the corresponding symmetric square distance matrix.<br>
2564 : ! \image html pm_distanceEuclid@dense.png width=500
2565 : !> </ol>
2566 : !> \param[in] subset : The input scalar that can be:
2567 : !> <ol>
2568 : !> <li> the constant [uppLowDia](@ref pm_matrixSubset::uppLowDia) or an object of type [uppLowDia_type](@ref pm_matrixSubset::uppLowDia_type),
2569 : !> indicating that the output `distance` must contain the full distance matrix of shape `(1:npnt, 1:npnt)` including the zero-valued diagonals.<br>
2570 : !> <li> the constant [uppLow](@ref pm_matrixSubset::uppLow) or an object of type [uppLow_type](@ref pm_matrixSubset::uppLow_type),
2571 : !> indicating that the output `distance` must exclude the zero-valued diagonals from the distance matrix yielding a distance matrix of shape `(1:npnt - 1, 1:npnt)`.<br>
2572 : !> **Motivation:** The zero-valued diagonal elements of the distance matrix are are frequently troubling for subsequent vector operations on the output distance matrix.<br>
2573 : !> Such vector operations include but are not limited to finding the extrema of distances, for example, the nearest and farthest neighbors.<br>
2574 : !> This `subset` value offers a fast convenient method of excluding self-distance values from the output distance matrix
2575 : !> such that each column `(1:npnt-1 , i)` of the distance matrix contains only the distances of `point(1:ndim, i)` with all other `npnt - 1` points in `point`.<br>
2576 : !> For example, finding the nearest neighbor of the points using the output distance matrix would be as simple as `minval(distance, 1)`.<br>
2577 : !> Finding the actual index of the point that is the nearest neighbor to each point would be slightly more involved as as two-step process:<br>
2578 : !> \code{.F90}
2579 : !> nn1loc(1 : npnt) = minloc(distance(1 : npnt - 1, 1 : npnt), 1)
2580 : !> nn1loc = merge(nn1loc, nn1loc + 1, getRange(1, npnt) <= nn1loc)
2581 : !> \endcode
2582 : !> where `nn1loc` is the vector of indices of the first nearest neighbors such that `point(:,nn1loc(i))` is the nearest neighbor to `point(:,i)`.<br>
2583 : !> \cond excluded
2584 : ! <li> the constant [uppDia](@ref pm_matrixSubset::uppDia) or an object of type [uppDia_type](@ref pm_matrixSubset::uppDia_type),
2585 : ! implying that only the upper-diagonal subset of the distance matrix must be returned.<br>
2586 : ! <li> the constant [lowDia](@ref pm_matrixSubset::lowDia) or an object of type [lowDia_type](@ref pm_matrixSubset::lowDia_type),
2587 : ! implying that only the lower-diagonal subset of the distance matrix must be returned.<br>
2588 : ! <li> the constant [upp](@ref pm_matrixSubset::upp) or an object of type [upp_type](@ref pm_matrixSubset::upp_type),
2589 : ! implying that only the upper-diagonal subset of the distance matrix must be returned.<br>
2590 : ! <li> the constant [low](@ref pm_matrixSubset::low) or an object of type [low_type](@ref pm_matrixSubset::low_type),
2591 : ! implying that only the lower-diagonal subset of the distance matrix must be returned.<br>
2592 : !> \endcond excluded
2593 : !> </ol>
2594 : !> \param[in] point : The input `contiguous` matrix of shape `(1:ndim, 1:npnt)` of,
2595 : !> <ol>
2596 : !> <li> type `real` of kind \RKALL,
2597 : !> </ol>
2598 : !> containing `npnt` points in the `ndim`-dimensional Euclidean space
2599 : !> whose distances with respect to each other must be computed and returned.<br>
2600 : !> \param[in] method : The input scalar that can be,<br>
2601 : !> <ol>
2602 : !> <li> the constant [euclid](@ref pm_distanceEuclid::euclid) or an object of type [euclid_type](@ref pm_distanceEuclid::euclid_type),
2603 : !> implying that all distance calculations must be done without undue numerical overflow.<br>
2604 : !> This option is computationally the most expensive method.<br>
2605 : !> <li> the constant [euclidu](@ref pm_distanceEuclid::euclidu) or an object of type [euclidu_type](@ref pm_distanceEuclid::euclidu_type),
2606 : !> implying that all distance calculations must be **without** runtime checks for numerical overflow.<br>
2607 : !> This option is computationally faster than the [euclid](@ref pm_distanceEuclid::euclid) method.<br>
2608 : !> <li> the constant [euclidsq](@ref pm_distanceEuclid::euclidsq) or an object of type [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)
2609 : !> implying that the **squared** values of all distance calculations must be returned **without** runtime checks for numerical overflow.<br>
2610 : !> This option is computationally the fastest approach to constructing the distance matrix because it avoid costly `sqrt()` operations and runtime overflow checks.<br>
2611 : !> </ol>
2612 : !>
2613 : !> \interface{setDisMatEuclid}
2614 : !> \code{.F90}
2615 : !>
2616 : !> use pm_distanceEuclid, only: setDisMatEuclid
2617 : !>
2618 : !> call setDisMatEuclid(distance(1:npnt, 1:npnt), pack, subset, point(1:npnt, 1:npnt), method)
2619 : !> call setDisMatEuclid(distance(1:npnt, 1:npnt), pack, subset, point(1:npnt, 1:npnt), method)
2620 : !>
2621 : !> \endcode
2622 : !>
2623 : !> \warning
2624 : !> The condition `size(point, 1) == size(point, 2)` must hold for the corresponding input arguments.<br>
2625 : !> The condition `shape(distance) == [size(point, 1), size(point, 1)] .or. .not. same_type_as(subset, uppLowDia)` must hold for the corresponding input arguments.<br>
2626 : !> The condition `shape(distance) == [size(point, 1) - 1, size(point, 1)] .or. .not. same_type_as(subset, uppLow)` must hold for the corresponding input arguments.<br>
2627 : !> \vericons
2628 : !>
2629 : !> \warnpure
2630 : !>
2631 : !> \see
2632 : !> [euclid](@ref pm_distanceEuclid::euclid)<br>
2633 : !> [euclidu](@ref pm_distanceEuclid::euclidu)<br>
2634 : !> [euclidsq](@ref pm_distanceEuclid::euclidsq)<br>
2635 : !> [euclid_type](@ref pm_distanceEuclid::euclid_type)<br>
2636 : !> [euclidu_type](@ref pm_distanceEuclid::euclidu_type)<br>
2637 : !> [euclidsq_type](@ref pm_distanceEuclid::euclidsq_type)<br>
2638 : !> [getDisEuclid](@ref pm_distanceEuclid::getDisEuclid)<br>
2639 : !> [setDisEuclid](@ref pm_distanceEuclid::setDisEuclid)<br>
2640 : !> [getDisMatEuclid](@ref pm_distanceEuclid::getDisMatEuclid)<br>
2641 : !> [setDisMatEuclid](@ref pm_distanceEuclid::setDisMatEuclid)<br>
2642 : !>
2643 : !> \example{setDisMatEuclid}
2644 : !> \include{lineno} example/pm_distanceEuclid/setDisMatEuclid/main.F90
2645 : !> \compilef{setDisMatEuclid}
2646 : !> \output{setDisMatEuclid}
2647 : !> \include{lineno} example/pm_distanceEuclid/setDisMatEuclid/main.out.F90
2648 : !>
2649 : !> \test
2650 : !> [test_pm_distanceEuclid](@ref test_pm_distanceEuclid)
2651 : !>
2652 : !> \todo
2653 : !> \phigh
2654 : !> This generic interface must be extended to allow other packing and subsets of the output distance matrix.
2655 : !>
2656 : !> \finmain{setDisMatEuclid}
2657 : !>
2658 : !> \author
2659 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
2660 :
2661 : ! rdpack, euclid
2662 :
2663 : interface setDisMatEuclid
2664 :
2665 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2666 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2667 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2668 :
2669 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2670 :
2671 : #if RK5_ENABLED
2672 : PURE module subroutine setDME_MED_RDP_ULD_RK5(distance, pack, subset, point, method)
2673 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2674 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULD_RK5
2675 : #endif
2676 : use pm_kind, only: RKC => RK5
2677 : real(RKC) , intent(in) , contiguous :: point(:,:)
2678 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2679 : type(euclid_type) , intent(in) :: method
2680 : type(uppLowDia_type), intent(in) :: subset
2681 : type(rdpack_type) , intent(in) :: pack
2682 : end subroutine
2683 : #endif
2684 :
2685 : #if RK4_ENABLED
2686 : PURE module subroutine setDME_MED_RDP_ULD_RK4(distance, pack, subset, point, method)
2687 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2688 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULD_RK4
2689 : #endif
2690 : use pm_kind, only: RKC => RK4
2691 : real(RKC) , intent(in) , contiguous :: point(:,:)
2692 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2693 : type(euclid_type) , intent(in) :: method
2694 : type(uppLowDia_type), intent(in) :: subset
2695 : type(rdpack_type) , intent(in) :: pack
2696 : end subroutine
2697 : #endif
2698 :
2699 : #if RK3_ENABLED
2700 : PURE module subroutine setDME_MED_RDP_ULD_RK3(distance, pack, subset, point, method)
2701 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2702 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULD_RK3
2703 : #endif
2704 : use pm_kind, only: RKC => RK3
2705 : real(RKC) , intent(in) , contiguous :: point(:,:)
2706 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2707 : type(euclid_type) , intent(in) :: method
2708 : type(uppLowDia_type), intent(in) :: subset
2709 : type(rdpack_type) , intent(in) :: pack
2710 : end subroutine
2711 : #endif
2712 :
2713 : #if RK2_ENABLED
2714 : PURE module subroutine setDME_MED_RDP_ULD_RK2(distance, pack, subset, point, method)
2715 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2716 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULD_RK2
2717 : #endif
2718 : use pm_kind, only: RKC => RK2
2719 : real(RKC) , intent(in) , contiguous :: point(:,:)
2720 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2721 : type(euclid_type) , intent(in) :: method
2722 : type(uppLowDia_type), intent(in) :: subset
2723 : type(rdpack_type) , intent(in) :: pack
2724 : end subroutine
2725 : #endif
2726 :
2727 : #if RK1_ENABLED
2728 : PURE module subroutine setDME_MED_RDP_ULD_RK1(distance, pack, subset, point, method)
2729 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2730 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULD_RK1
2731 : #endif
2732 : use pm_kind, only: RKC => RK1
2733 : real(RKC) , intent(in) , contiguous :: point(:,:)
2734 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2735 : type(euclid_type) , intent(in) :: method
2736 : type(uppLowDia_type), intent(in) :: subset
2737 : type(rdpack_type) , intent(in) :: pack
2738 : end subroutine
2739 : #endif
2740 :
2741 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2742 :
2743 : #if RK5_ENABLED
2744 : PURE module subroutine setDME_MED_RDP_ULX_RK5(distance, pack, subset, point, method)
2745 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2746 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULX_RK5
2747 : #endif
2748 : use pm_kind, only: RKC => RK5
2749 : real(RKC) , intent(in) , contiguous :: point(:,:)
2750 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2751 : type(euclid_type) , intent(in) :: method
2752 : type(uppLow_type) , intent(in) :: subset
2753 : type(rdpack_type) , intent(in) :: pack
2754 : end subroutine
2755 : #endif
2756 :
2757 : #if RK4_ENABLED
2758 : PURE module subroutine setDME_MED_RDP_ULX_RK4(distance, pack, subset, point, method)
2759 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2760 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULX_RK4
2761 : #endif
2762 : use pm_kind, only: RKC => RK4
2763 : real(RKC) , intent(in) , contiguous :: point(:,:)
2764 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2765 : type(euclid_type) , intent(in) :: method
2766 : type(uppLow_type) , intent(in) :: subset
2767 : type(rdpack_type) , intent(in) :: pack
2768 : end subroutine
2769 : #endif
2770 :
2771 : #if RK3_ENABLED
2772 : PURE module subroutine setDME_MED_RDP_ULX_RK3(distance, pack, subset, point, method)
2773 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2774 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULX_RK3
2775 : #endif
2776 : use pm_kind, only: RKC => RK3
2777 : real(RKC) , intent(in) , contiguous :: point(:,:)
2778 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2779 : type(euclid_type) , intent(in) :: method
2780 : type(uppLow_type) , intent(in) :: subset
2781 : type(rdpack_type) , intent(in) :: pack
2782 : end subroutine
2783 : #endif
2784 :
2785 : #if RK2_ENABLED
2786 : PURE module subroutine setDME_MED_RDP_ULX_RK2(distance, pack, subset, point, method)
2787 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2788 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULX_RK2
2789 : #endif
2790 : use pm_kind, only: RKC => RK2
2791 : real(RKC) , intent(in) , contiguous :: point(:,:)
2792 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2793 : type(euclid_type) , intent(in) :: method
2794 : type(uppLow_type) , intent(in) :: subset
2795 : type(rdpack_type) , intent(in) :: pack
2796 : end subroutine
2797 : #endif
2798 :
2799 : #if RK1_ENABLED
2800 : PURE module subroutine setDME_MED_RDP_ULX_RK1(distance, pack, subset, point, method)
2801 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2802 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MED_RDP_ULX_RK1
2803 : #endif
2804 : use pm_kind, only: RKC => RK1
2805 : real(RKC) , intent(in) , contiguous :: point(:,:)
2806 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2807 : type(euclid_type) , intent(in) :: method
2808 : type(uppLow_type) , intent(in) :: subset
2809 : type(rdpack_type) , intent(in) :: pack
2810 : end subroutine
2811 : #endif
2812 :
2813 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2814 :
2815 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2816 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2817 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2818 :
2819 : end interface
2820 :
2821 : ! rdpack, euclidu
2822 :
2823 : interface setDisMatEuclid
2824 :
2825 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2826 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2827 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2828 :
2829 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2830 :
2831 : #if RK5_ENABLED
2832 : PURE module subroutine setDME_MEU_RDP_ULD_RK5(distance, pack, subset, point, method)
2833 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2834 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULD_RK5
2835 : #endif
2836 : use pm_kind, only: RKC => RK5
2837 : real(RKC) , intent(in) , contiguous :: point(:,:)
2838 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2839 : type(euclidu_type) , intent(in) :: method
2840 : type(uppLowDia_type), intent(in) :: subset
2841 : type(rdpack_type) , intent(in) :: pack
2842 : end subroutine
2843 : #endif
2844 :
2845 : #if RK4_ENABLED
2846 : PURE module subroutine setDME_MEU_RDP_ULD_RK4(distance, pack, subset, point, method)
2847 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2848 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULD_RK4
2849 : #endif
2850 : use pm_kind, only: RKC => RK4
2851 : real(RKC) , intent(in) , contiguous :: point(:,:)
2852 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2853 : type(euclidu_type) , intent(in) :: method
2854 : type(uppLowDia_type), intent(in) :: subset
2855 : type(rdpack_type) , intent(in) :: pack
2856 : end subroutine
2857 : #endif
2858 :
2859 : #if RK3_ENABLED
2860 : PURE module subroutine setDME_MEU_RDP_ULD_RK3(distance, pack, subset, point, method)
2861 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2862 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULD_RK3
2863 : #endif
2864 : use pm_kind, only: RKC => RK3
2865 : real(RKC) , intent(in) , contiguous :: point(:,:)
2866 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2867 : type(euclidu_type) , intent(in) :: method
2868 : type(uppLowDia_type), intent(in) :: subset
2869 : type(rdpack_type) , intent(in) :: pack
2870 : end subroutine
2871 : #endif
2872 :
2873 : #if RK2_ENABLED
2874 : PURE module subroutine setDME_MEU_RDP_ULD_RK2(distance, pack, subset, point, method)
2875 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2876 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULD_RK2
2877 : #endif
2878 : use pm_kind, only: RKC => RK2
2879 : real(RKC) , intent(in) , contiguous :: point(:,:)
2880 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2881 : type(euclidu_type) , intent(in) :: method
2882 : type(uppLowDia_type), intent(in) :: subset
2883 : type(rdpack_type) , intent(in) :: pack
2884 : end subroutine
2885 : #endif
2886 :
2887 : #if RK1_ENABLED
2888 : PURE module subroutine setDME_MEU_RDP_ULD_RK1(distance, pack, subset, point, method)
2889 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2890 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULD_RK1
2891 : #endif
2892 : use pm_kind, only: RKC => RK1
2893 : real(RKC) , intent(in) , contiguous :: point(:,:)
2894 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2895 : type(euclidu_type) , intent(in) :: method
2896 : type(uppLowDia_type), intent(in) :: subset
2897 : type(rdpack_type) , intent(in) :: pack
2898 : end subroutine
2899 : #endif
2900 :
2901 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2902 :
2903 : #if RK5_ENABLED
2904 : PURE module subroutine setDME_MEU_RDP_ULX_RK5(distance, pack, subset, point, method)
2905 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2906 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULX_RK5
2907 : #endif
2908 : use pm_kind, only: RKC => RK5
2909 : real(RKC) , intent(in) , contiguous :: point(:,:)
2910 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2911 : type(euclidu_type) , intent(in) :: method
2912 : type(uppLow_type) , intent(in) :: subset
2913 : type(rdpack_type) , intent(in) :: pack
2914 : end subroutine
2915 : #endif
2916 :
2917 : #if RK4_ENABLED
2918 : PURE module subroutine setDME_MEU_RDP_ULX_RK4(distance, pack, subset, point, method)
2919 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2920 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULX_RK4
2921 : #endif
2922 : use pm_kind, only: RKC => RK4
2923 : real(RKC) , intent(in) , contiguous :: point(:,:)
2924 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2925 : type(euclidu_type) , intent(in) :: method
2926 : type(uppLow_type) , intent(in) :: subset
2927 : type(rdpack_type) , intent(in) :: pack
2928 : end subroutine
2929 : #endif
2930 :
2931 : #if RK3_ENABLED
2932 : PURE module subroutine setDME_MEU_RDP_ULX_RK3(distance, pack, subset, point, method)
2933 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2934 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULX_RK3
2935 : #endif
2936 : use pm_kind, only: RKC => RK3
2937 : real(RKC) , intent(in) , contiguous :: point(:,:)
2938 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2939 : type(euclidu_type) , intent(in) :: method
2940 : type(uppLow_type) , intent(in) :: subset
2941 : type(rdpack_type) , intent(in) :: pack
2942 : end subroutine
2943 : #endif
2944 :
2945 : #if RK2_ENABLED
2946 : PURE module subroutine setDME_MEU_RDP_ULX_RK2(distance, pack, subset, point, method)
2947 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2948 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULX_RK2
2949 : #endif
2950 : use pm_kind, only: RKC => RK2
2951 : real(RKC) , intent(in) , contiguous :: point(:,:)
2952 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2953 : type(euclidu_type) , intent(in) :: method
2954 : type(uppLow_type) , intent(in) :: subset
2955 : type(rdpack_type) , intent(in) :: pack
2956 : end subroutine
2957 : #endif
2958 :
2959 : #if RK1_ENABLED
2960 : PURE module subroutine setDME_MEU_RDP_ULX_RK1(distance, pack, subset, point, method)
2961 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2962 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEU_RDP_ULX_RK1
2963 : #endif
2964 : use pm_kind, only: RKC => RK1
2965 : real(RKC) , intent(in) , contiguous :: point(:,:)
2966 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2967 : type(euclidu_type) , intent(in) :: method
2968 : type(uppLow_type) , intent(in) :: subset
2969 : type(rdpack_type) , intent(in) :: pack
2970 : end subroutine
2971 : #endif
2972 :
2973 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2974 :
2975 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2976 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2977 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2978 :
2979 : end interface
2980 :
2981 : ! rdpack, euclidsq
2982 :
2983 : interface setDisMatEuclid
2984 :
2985 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2986 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2987 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2988 :
2989 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2990 :
2991 : #if RK5_ENABLED
2992 : PURE module subroutine setDME_MEQ_RDP_ULD_RK5(distance, pack, subset, point, method)
2993 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2994 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULD_RK5
2995 : #endif
2996 : use pm_kind, only: RKC => RK5
2997 : real(RKC) , intent(in) , contiguous :: point(:,:)
2998 : real(RKC) , intent(out) , contiguous :: distance(:,:)
2999 : type(euclidsq_type) , intent(in) :: method
3000 : type(uppLowDia_type), intent(in) :: subset
3001 : type(rdpack_type) , intent(in) :: pack
3002 : end subroutine
3003 : #endif
3004 :
3005 : #if RK4_ENABLED
3006 : PURE module subroutine setDME_MEQ_RDP_ULD_RK4(distance, pack, subset, point, method)
3007 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3008 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULD_RK4
3009 : #endif
3010 : use pm_kind, only: RKC => RK4
3011 : real(RKC) , intent(in) , contiguous :: point(:,:)
3012 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3013 : type(euclidsq_type) , intent(in) :: method
3014 : type(uppLowDia_type), intent(in) :: subset
3015 : type(rdpack_type) , intent(in) :: pack
3016 : end subroutine
3017 : #endif
3018 :
3019 : #if RK3_ENABLED
3020 : PURE module subroutine setDME_MEQ_RDP_ULD_RK3(distance, pack, subset, point, method)
3021 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3022 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULD_RK3
3023 : #endif
3024 : use pm_kind, only: RKC => RK3
3025 : real(RKC) , intent(in) , contiguous :: point(:,:)
3026 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3027 : type(euclidsq_type) , intent(in) :: method
3028 : type(uppLowDia_type), intent(in) :: subset
3029 : type(rdpack_type) , intent(in) :: pack
3030 : end subroutine
3031 : #endif
3032 :
3033 : #if RK2_ENABLED
3034 : PURE module subroutine setDME_MEQ_RDP_ULD_RK2(distance, pack, subset, point, method)
3035 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3036 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULD_RK2
3037 : #endif
3038 : use pm_kind, only: RKC => RK2
3039 : real(RKC) , intent(in) , contiguous :: point(:,:)
3040 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3041 : type(euclidsq_type) , intent(in) :: method
3042 : type(uppLowDia_type), intent(in) :: subset
3043 : type(rdpack_type) , intent(in) :: pack
3044 : end subroutine
3045 : #endif
3046 :
3047 : #if RK1_ENABLED
3048 : PURE module subroutine setDME_MEQ_RDP_ULD_RK1(distance, pack, subset, point, method)
3049 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3050 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULD_RK1
3051 : #endif
3052 : use pm_kind, only: RKC => RK1
3053 : real(RKC) , intent(in) , contiguous :: point(:,:)
3054 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3055 : type(euclidsq_type) , intent(in) :: method
3056 : type(uppLowDia_type), intent(in) :: subset
3057 : type(rdpack_type) , intent(in) :: pack
3058 : end subroutine
3059 : #endif
3060 :
3061 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3062 :
3063 : #if RK5_ENABLED
3064 : PURE module subroutine setDME_MEQ_RDP_ULX_RK5(distance, pack, subset, point, method)
3065 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3066 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULX_RK5
3067 : #endif
3068 : use pm_kind, only: RKC => RK5
3069 : real(RKC) , intent(in) , contiguous :: point(:,:)
3070 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3071 : type(euclidsq_type) , intent(in) :: method
3072 : type(uppLow_type) , intent(in) :: subset
3073 : type(rdpack_type) , intent(in) :: pack
3074 : end subroutine
3075 : #endif
3076 :
3077 : #if RK4_ENABLED
3078 : PURE module subroutine setDME_MEQ_RDP_ULX_RK4(distance, pack, subset, point, method)
3079 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3080 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULX_RK4
3081 : #endif
3082 : use pm_kind, only: RKC => RK4
3083 : real(RKC) , intent(in) , contiguous :: point(:,:)
3084 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3085 : type(euclidsq_type) , intent(in) :: method
3086 : type(uppLow_type) , intent(in) :: subset
3087 : type(rdpack_type) , intent(in) :: pack
3088 : end subroutine
3089 : #endif
3090 :
3091 : #if RK3_ENABLED
3092 : PURE module subroutine setDME_MEQ_RDP_ULX_RK3(distance, pack, subset, point, method)
3093 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3094 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULX_RK3
3095 : #endif
3096 : use pm_kind, only: RKC => RK3
3097 : real(RKC) , intent(in) , contiguous :: point(:,:)
3098 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3099 : type(euclidsq_type) , intent(in) :: method
3100 : type(uppLow_type) , intent(in) :: subset
3101 : type(rdpack_type) , intent(in) :: pack
3102 : end subroutine
3103 : #endif
3104 :
3105 : #if RK2_ENABLED
3106 : PURE module subroutine setDME_MEQ_RDP_ULX_RK2(distance, pack, subset, point, method)
3107 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3108 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULX_RK2
3109 : #endif
3110 : use pm_kind, only: RKC => RK2
3111 : real(RKC) , intent(in) , contiguous :: point(:,:)
3112 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3113 : type(euclidsq_type) , intent(in) :: method
3114 : type(uppLow_type) , intent(in) :: subset
3115 : type(rdpack_type) , intent(in) :: pack
3116 : end subroutine
3117 : #endif
3118 :
3119 : #if RK1_ENABLED
3120 : PURE module subroutine setDME_MEQ_RDP_ULX_RK1(distance, pack, subset, point, method)
3121 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3122 : !DEC$ ATTRIBUTES DLLEXPORT :: setDME_MEQ_RDP_ULX_RK1
3123 : #endif
3124 : use pm_kind, only: RKC => RK1
3125 : real(RKC) , intent(in) , contiguous :: point(:,:)
3126 : real(RKC) , intent(out) , contiguous :: distance(:,:)
3127 : type(euclidsq_type) , intent(in) :: method
3128 : type(uppLow_type) , intent(in) :: subset
3129 : type(rdpack_type) , intent(in) :: pack
3130 : end subroutine
3131 : #endif
3132 :
3133 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3134 :
3135 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3136 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3137 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3138 :
3139 : end interface
3140 :
3141 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3142 :
3143 456 : end module pm_distanceEuclid
|