ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_clustering.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
32
33!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34
36
37 use pm_kind, only: SK, IK, LK
39
40 implicit none
41
42 character(*, SK), parameter :: MODULE_NAME = "@pm_clustering"
43
44!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
126 interface setMember
127
128 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
129
130#if RK5_ENABLED
131 PURE module subroutine setMemberEuc_D0_D1_RK5(membership, disq, sample, center)
132#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
133 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D0_D1_RK5
134#endif
135 use pm_kind, only: RKG => RK5
136 real(RKG) , intent(in) :: sample
137 real(RKG) , intent(in) , contiguous :: center(:)
138 real(RKG) , intent(out) :: disq
139 integer(IK) , intent(out) :: membership
140 end subroutine
141#endif
142
143#if RK4_ENABLED
144 PURE module subroutine setMemberEuc_D0_D1_RK4(membership, disq, sample, center)
145#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
146 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D0_D1_RK4
147#endif
148 use pm_kind, only: RKG => RK4
149 real(RKG) , intent(in) :: sample
150 real(RKG) , intent(in) , contiguous :: center(:)
151 real(RKG) , intent(out) :: disq
152 integer(IK) , intent(out) :: membership
153 end subroutine
154#endif
155
156#if RK3_ENABLED
157 PURE module subroutine setMemberEuc_D0_D1_RK3(membership, disq, sample, center)
158#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
159 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D0_D1_RK3
160#endif
161 use pm_kind, only: RKG => RK3
162 real(RKG) , intent(in) :: sample
163 real(RKG) , intent(in) , contiguous :: center(:)
164 real(RKG) , intent(out) :: disq
165 integer(IK) , intent(out) :: membership
166 end subroutine
167#endif
168
169#if RK2_ENABLED
170 PURE module subroutine setMemberEuc_D0_D1_RK2(membership, disq, sample, center)
171#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
172 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D0_D1_RK2
173#endif
174 use pm_kind, only: RKG => RK2
175 real(RKG) , intent(in) :: sample
176 real(RKG) , intent(in) , contiguous :: center(:)
177 real(RKG) , intent(out) :: disq
178 integer(IK) , intent(out) :: membership
179 end subroutine
180#endif
181
182#if RK1_ENABLED
183 PURE module subroutine setMemberEuc_D0_D1_RK1(membership, disq, sample, center)
184#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
185 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D0_D1_RK1
186#endif
187 use pm_kind, only: RKG => RK1
188 real(RKG) , intent(in) :: sample
189 real(RKG) , intent(in) , contiguous :: center(:)
190 real(RKG) , intent(out) :: disq
191 integer(IK) , intent(out) :: membership
192 end subroutine
193#endif
194
195 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196
197#if RK5_ENABLED
198 PURE module subroutine setMemberEuc_D1_D1_RK5(membership, disq, sample, center)
199#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
200 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D1_RK5
201#endif
202 use pm_kind, only: RKG => RK5
203 real(RKG) , intent(in) , contiguous :: sample(:)
204 real(RKG) , intent(in) , contiguous :: center(:)
205 real(RKG) , intent(out) , contiguous :: disq(:)
206 integer(IK) , intent(out) , contiguous :: membership(:)
207 end subroutine
208#endif
209
210#if RK4_ENABLED
211 PURE module subroutine setMemberEuc_D1_D1_RK4(membership, disq, sample, center)
212#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
213 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D1_RK4
214#endif
215 use pm_kind, only: RKG => RK4
216 real(RKG) , intent(in) , contiguous :: sample(:)
217 real(RKG) , intent(in) , contiguous :: center(:)
218 real(RKG) , intent(out) , contiguous :: disq(:)
219 integer(IK) , intent(out) , contiguous :: membership(:)
220 end subroutine
221#endif
222
223#if RK3_ENABLED
224 PURE module subroutine setMemberEuc_D1_D1_RK3(membership, disq, sample, center)
225#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
226 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D1_RK3
227#endif
228 use pm_kind, only: RKG => RK3
229 real(RKG) , intent(in) , contiguous :: sample(:)
230 real(RKG) , intent(in) , contiguous :: center(:)
231 real(RKG) , intent(out) , contiguous :: disq(:)
232 integer(IK) , intent(out) , contiguous :: membership(:)
233 end subroutine
234#endif
235
236#if RK2_ENABLED
237 PURE module subroutine setMemberEuc_D1_D1_RK2(membership, disq, sample, center)
238#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
239 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D1_RK2
240#endif
241 use pm_kind, only: RKG => RK2
242 real(RKG) , intent(in) , contiguous :: sample(:)
243 real(RKG) , intent(in) , contiguous :: center(:)
244 real(RKG) , intent(out) , contiguous :: disq(:)
245 integer(IK) , intent(out) , contiguous :: membership(:)
246 end subroutine
247#endif
248
249#if RK1_ENABLED
250 PURE module subroutine setMemberEuc_D1_D1_RK1(membership, disq, sample, center)
251#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
252 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D1_RK1
253#endif
254 use pm_kind, only: RKG => RK1
255 real(RKG) , intent(in) , contiguous :: sample(:)
256 real(RKG) , intent(in) , contiguous :: center(:)
257 real(RKG) , intent(out) , contiguous :: disq(:)
258 integer(IK) , intent(out) , contiguous :: membership(:)
259 end subroutine
260#endif
261
262 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263
264#if RK5_ENABLED
265 PURE module subroutine setMemberEuc_D1_D2_RK5(membership, disq, sample, center)
266#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
267 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D2_RK5
268#endif
269 use pm_kind, only: RKG => RK5
270 real(RKG) , intent(in) , contiguous :: sample(:)
271 real(RKG) , intent(in) , contiguous :: center(:,:)
272 real(RKG) , intent(out) :: disq
273 integer(IK) , intent(out) :: membership
274 end subroutine
275#endif
276
277#if RK4_ENABLED
278 PURE module subroutine setMemberEuc_D1_D2_RK4(membership, disq, sample, center)
279#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
280 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D2_RK4
281#endif
282 use pm_kind, only: RKG => RK4
283 real(RKG) , intent(in) , contiguous :: sample(:)
284 real(RKG) , intent(in) , contiguous :: center(:,:)
285 real(RKG) , intent(out) :: disq
286 integer(IK) , intent(out) :: membership
287 end subroutine
288#endif
289
290#if RK3_ENABLED
291 PURE module subroutine setMemberEuc_D1_D2_RK3(membership, disq, sample, center)
292#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
293 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D2_RK3
294#endif
295 use pm_kind, only: RKG => RK3
296 real(RKG) , intent(in) , contiguous :: sample(:)
297 real(RKG) , intent(in) , contiguous :: center(:,:)
298 real(RKG) , intent(out) :: disq
299 integer(IK) , intent(out) :: membership
300 end subroutine
301#endif
302
303#if RK2_ENABLED
304 PURE module subroutine setMemberEuc_D1_D2_RK2(membership, disq, sample, center)
305#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
306 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D2_RK2
307#endif
308 use pm_kind, only: RKG => RK2
309 real(RKG) , intent(in) , contiguous :: sample(:)
310 real(RKG) , intent(in) , contiguous :: center(:,:)
311 real(RKG) , intent(out) :: disq
312 integer(IK) , intent(out) :: membership
313 end subroutine
314#endif
315
316#if RK1_ENABLED
317 PURE module subroutine setMemberEuc_D1_D2_RK1(membership, disq, sample, center)
318#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
319 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D1_D2_RK1
320#endif
321 use pm_kind, only: RKG => RK1
322 real(RKG) , intent(in) , contiguous :: sample(:)
323 real(RKG) , intent(in) , contiguous :: center(:,:)
324 real(RKG) , intent(out) :: disq
325 integer(IK) , intent(out) :: membership
326 end subroutine
327#endif
328
329 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330
331#if RK5_ENABLED
332 PURE module subroutine setMemberEuc_D2_D2_RK5(membership, disq, sample, center)
333#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
334 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D2_D2_RK5
335#endif
336 use pm_kind, only: RKG => RK5
337 real(RKG) , intent(in) , contiguous :: sample(:,:)
338 real(RKG) , intent(in) , contiguous :: center(:,:)
339 real(RKG) , intent(out) , contiguous :: disq(:)
340 integer(IK) , intent(out) , contiguous :: membership(:)
341 end subroutine
342#endif
343
344#if RK4_ENABLED
345 PURE module subroutine setMemberEuc_D2_D2_RK4(membership, disq, sample, center)
346#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
347 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D2_D2_RK4
348#endif
349 use pm_kind, only: RKG => RK4
350 real(RKG) , intent(in) , contiguous :: sample(:,:)
351 real(RKG) , intent(in) , contiguous :: center(:,:)
352 real(RKG) , intent(out) , contiguous :: disq(:)
353 integer(IK) , intent(out) , contiguous :: membership(:)
354 end subroutine
355#endif
356
357#if RK3_ENABLED
358 PURE module subroutine setMemberEuc_D2_D2_RK3(membership, disq, sample, center)
359#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
360 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D2_D2_RK3
361#endif
362 use pm_kind, only: RKG => RK3
363 real(RKG) , intent(in) , contiguous :: sample(:,:)
364 real(RKG) , intent(in) , contiguous :: center(:,:)
365 real(RKG) , intent(out) , contiguous :: disq(:)
366 integer(IK) , intent(out) , contiguous :: membership(:)
367 end subroutine
368#endif
369
370#if RK2_ENABLED
371 PURE module subroutine setMemberEuc_D2_D2_RK2(membership, disq, sample, center)
372#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
373 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D2_D2_RK2
374#endif
375 use pm_kind, only: RKG => RK2
376 real(RKG) , intent(in) , contiguous :: sample(:,:)
377 real(RKG) , intent(in) , contiguous :: center(:,:)
378 real(RKG) , intent(out) , contiguous :: disq(:)
379 integer(IK) , intent(out) , contiguous :: membership(:)
380 end subroutine
381#endif
382
383#if RK1_ENABLED
384 PURE module subroutine setMemberEuc_D2_D2_RK1(membership, disq, sample, center)
385#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
386 !DEC$ ATTRIBUTES DLLEXPORT :: setMemberEuc_D2_D2_RK1
387#endif
388 use pm_kind, only: RKG => RK1
389 real(RKG) , intent(in) , contiguous :: sample(:,:)
390 real(RKG) , intent(in) , contiguous :: center(:,:)
391 real(RKG) , intent(out) , contiguous :: disq(:)
392 integer(IK) , intent(out) , contiguous :: membership(:)
393 end subroutine
394#endif
395
396 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
397
398 end interface
399
400!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
401
485 interface setCenter
486
487 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488
489#if RK5_ENABLED
490 PURE module subroutine setCenterEuc_D1_D1_RK5(membership, disq, sample, center, size, potential)
491#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
492 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D1_D1_RK5
493#endif
494 use pm_kind, only: RKG => RK5
495 real(RKG) , intent(in) , contiguous :: sample(:)
496 real(RKG) , intent(in) , contiguous :: disq(:)
497 integer(IK) , intent(in) , contiguous :: membership(:)
498 real(RKG) , intent(out) , contiguous :: center(:)
499 real(RKG) , intent(out) , contiguous :: potential(:)
500 integer(IK) , intent(out) , contiguous :: size(:)
501 end subroutine
502#endif
503
504#if RK4_ENABLED
505 PURE module subroutine setCenterEuc_D1_D1_RK4(membership, disq, sample, center, size, potential)
506#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
507 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D1_D1_RK4
508#endif
509 use pm_kind, only: RKG => RK4
510 real(RKG) , intent(in) , contiguous :: sample(:)
511 real(RKG) , intent(in) , contiguous :: disq(:)
512 integer(IK) , intent(in) , contiguous :: membership(:)
513 real(RKG) , intent(out) , contiguous :: center(:)
514 real(RKG) , intent(out) , contiguous :: potential(:)
515 integer(IK) , intent(out) , contiguous :: size(:)
516 end subroutine
517#endif
518
519#if RK3_ENABLED
520 PURE module subroutine setCenterEuc_D1_D1_RK3(membership, disq, sample, center, size, potential)
521#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
522 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D1_D1_RK3
523#endif
524 use pm_kind, only: RKG => RK3
525 real(RKG) , intent(in) , contiguous :: sample(:)
526 real(RKG) , intent(in) , contiguous :: disq(:)
527 integer(IK) , intent(in) , contiguous :: membership(:)
528 real(RKG) , intent(out) , contiguous :: center(:)
529 real(RKG) , intent(out) , contiguous :: potential(:)
530 integer(IK) , intent(out) , contiguous :: size(:)
531 end subroutine
532#endif
533
534#if RK2_ENABLED
535 PURE module subroutine setCenterEuc_D1_D1_RK2(membership, disq, sample, center, size, potential)
536#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
537 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D1_D1_RK2
538#endif
539 use pm_kind, only: RKG => RK2
540 real(RKG) , intent(in) , contiguous :: sample(:)
541 real(RKG) , intent(in) , contiguous :: disq(:)
542 integer(IK) , intent(in) , contiguous :: membership(:)
543 real(RKG) , intent(out) , contiguous :: center(:)
544 real(RKG) , intent(out) , contiguous :: potential(:)
545 integer(IK) , intent(out) , contiguous :: size(:)
546 end subroutine
547#endif
548
549#if RK1_ENABLED
550 PURE module subroutine setCenterEuc_D1_D1_RK1(membership, disq, sample, center, size, potential)
551#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
552 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D1_D1_RK1
553#endif
554 use pm_kind, only: RKG => RK1
555 real(RKG) , intent(in) , contiguous :: sample(:)
556 real(RKG) , intent(in) , contiguous :: disq(:)
557 integer(IK) , intent(in) , contiguous :: membership(:)
558 real(RKG) , intent(out) , contiguous :: center(:)
559 real(RKG) , intent(out) , contiguous :: potential(:)
560 integer(IK) , intent(out) , contiguous :: size(:)
561 end subroutine
562#endif
563
564 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
565
566#if RK5_ENABLED
567 PURE module subroutine setCenterEuc_D2_D2_RK5(membership, disq, sample, center, size, potential)
568#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
569 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D2_D2_RK5
570#endif
571 use pm_kind, only: RKG => RK5
572 real(RKG) , intent(in) , contiguous :: sample(:,:)
573 real(RKG) , intent(in) , contiguous :: disq(:)
574 integer(IK) , intent(in) , contiguous :: membership(:)
575 real(RKG) , intent(out) , contiguous :: center(:,:)
576 integer(IK) , intent(out) , contiguous :: size(:)
577 real(RKG) , intent(out) , contiguous :: potential(:)
578 end subroutine
579#endif
580
581#if RK4_ENABLED
582 PURE module subroutine setCenterEuc_D2_D2_RK4(membership, disq, sample, center, size, potential)
583#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
584 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D2_D2_RK4
585#endif
586 use pm_kind, only: RKG => RK4
587 real(RKG) , intent(in) , contiguous :: sample(:,:)
588 real(RKG) , intent(in) , contiguous :: disq(:)
589 integer(IK) , intent(in) , contiguous :: membership(:)
590 real(RKG) , intent(out) , contiguous :: center(:,:)
591 integer(IK) , intent(out) , contiguous :: size(:)
592 real(RKG) , intent(out) , contiguous :: potential(:)
593 end subroutine
594#endif
595
596#if RK3_ENABLED
597 PURE module subroutine setCenterEuc_D2_D2_RK3(membership, disq, sample, center, size, potential)
598#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
599 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D2_D2_RK3
600#endif
601 use pm_kind, only: RKG => RK3
602 real(RKG) , intent(in) , contiguous :: sample(:,:)
603 real(RKG) , intent(in) , contiguous :: disq(:)
604 integer(IK) , intent(in) , contiguous :: membership(:)
605 real(RKG) , intent(out) , contiguous :: center(:,:)
606 integer(IK) , intent(out) , contiguous :: size(:)
607 real(RKG) , intent(out) , contiguous :: potential(:)
608 end subroutine
609#endif
610
611#if RK2_ENABLED
612 PURE module subroutine setCenterEuc_D2_D2_RK2(membership, disq, sample, center, size, potential)
613#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
614 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D2_D2_RK2
615#endif
616 use pm_kind, only: RKG => RK2
617 real(RKG) , intent(in) , contiguous :: sample(:,:)
618 real(RKG) , intent(in) , contiguous :: disq(:)
619 integer(IK) , intent(in) , contiguous :: membership(:)
620 real(RKG) , intent(out) , contiguous :: center(:,:)
621 integer(IK) , intent(out) , contiguous :: size(:)
622 real(RKG) , intent(out) , contiguous :: potential(:)
623 end subroutine
624#endif
625
626#if RK1_ENABLED
627 PURE module subroutine setCenterEuc_D2_D2_RK1(membership, disq, sample, center, size, potential)
628#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
629 !DEC$ ATTRIBUTES DLLEXPORT :: setCenterEuc_D2_D2_RK1
630#endif
631 use pm_kind, only: RKG => RK1
632 real(RKG) , intent(in) , contiguous :: sample(:,:)
633 real(RKG) , intent(in) , contiguous :: disq(:)
634 integer(IK) , intent(in) , contiguous :: membership(:)
635 real(RKG) , intent(out) , contiguous :: center(:,:)
636 integer(IK) , intent(out) , contiguous :: size(:)
637 real(RKG) , intent(out) , contiguous :: potential(:)
638 end subroutine
639#endif
640
641 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
642
643 end interface
644
645!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
646
787 interface setKmeansPP
788
789 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
790 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
791 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
792
793 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
794
795#if RK5_ENABLED
796 impure module subroutine setKmeansPPDRNGF_RK5(rng, membership, disq, sample, ncls)
797#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
798 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGF_RK5
799#endif
800 use pm_kind, only: RKG => RK5
801 type(rngf_type) , intent(in) :: rng
802 integer(IK) , intent(in) :: ncls
803 real(RKG) , intent(in) , contiguous :: sample(:,:)
804 real(RKG) , intent(out) , contiguous :: disq(:)
805 integer(IK) , intent(out) , contiguous :: membership(:)
806 end subroutine
807#endif
808
809#if RK4_ENABLED
810 impure module subroutine setKmeansPPDRNGF_RK4(rng, membership, disq, sample, ncls)
811#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
812 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGF_RK4
813#endif
814 use pm_kind, only: RKG => RK4
815 type(rngf_type) , intent(in) :: rng
816 integer(IK) , intent(in) :: ncls
817 real(RKG) , intent(in) , contiguous :: sample(:,:)
818 real(RKG) , intent(out) , contiguous :: disq(:)
819 integer(IK) , intent(out) , contiguous :: membership(:)
820 end subroutine
821#endif
822
823#if RK3_ENABLED
824 impure module subroutine setKmeansPPDRNGF_RK3(rng, membership, disq, sample, ncls)
825#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
826 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGF_RK3
827#endif
828 use pm_kind, only: RKG => RK3
829 type(rngf_type) , intent(in) :: rng
830 integer(IK) , intent(in) :: ncls
831 real(RKG) , intent(in) , contiguous :: sample(:,:)
832 real(RKG) , intent(out) , contiguous :: disq(:)
833 integer(IK) , intent(out) , contiguous :: membership(:)
834 end subroutine
835#endif
836
837#if RK2_ENABLED
838 impure module subroutine setKmeansPPDRNGF_RK2(rng, membership, disq, sample, ncls)
839#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
840 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGF_RK2
841#endif
842 use pm_kind, only: RKG => RK2
843 type(rngf_type) , intent(in) :: rng
844 integer(IK) , intent(in) :: ncls
845 real(RKG) , intent(in) , contiguous :: sample(:,:)
846 real(RKG) , intent(out) , contiguous :: disq(:)
847 integer(IK) , intent(out) , contiguous :: membership(:)
848 end subroutine
849#endif
850
851#if RK1_ENABLED
852 impure module subroutine setKmeansPPDRNGF_RK1(rng, membership, disq, sample, ncls)
853#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
854 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGF_RK1
855#endif
856 use pm_kind, only: RKG => RK1
857 type(rngf_type) , intent(in) :: rng
858 integer(IK) , intent(in) :: ncls
859 real(RKG) , intent(in) , contiguous :: sample(:,:)
860 real(RKG) , intent(out) , contiguous :: disq(:)
861 integer(IK) , intent(out) , contiguous :: membership(:)
862 end subroutine
863#endif
864
865 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
866
867#if RK5_ENABLED
868 PURE module subroutine setKmeansPPDRNGX_RK5(rng, membership, disq, sample, ncls)
869#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
870 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGX_RK5
871#endif
872 use pm_kind, only: RKG => RK5
873 type(xoshiro256ssw_type), intent(inout) :: rng
874 integer(IK) , intent(in) :: ncls
875 real(RKG) , intent(in) , contiguous :: sample(:,:)
876 real(RKG) , intent(out) , contiguous :: disq(:)
877 integer(IK) , intent(out) , contiguous :: membership(:)
878 end subroutine
879#endif
880
881#if RK4_ENABLED
882 PURE module subroutine setKmeansPPDRNGX_RK4(rng, membership, disq, sample, ncls)
883#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
884 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGX_RK4
885#endif
886 use pm_kind, only: RKG => RK4
887 type(xoshiro256ssw_type), intent(inout) :: rng
888 integer(IK) , intent(in) :: ncls
889 real(RKG) , intent(in) , contiguous :: sample(:,:)
890 real(RKG) , intent(out) , contiguous :: disq(:)
891 integer(IK) , intent(out) , contiguous :: membership(:)
892 end subroutine
893#endif
894
895#if RK3_ENABLED
896 PURE module subroutine setKmeansPPDRNGX_RK3(rng, membership, disq, sample, ncls)
897#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
898 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGX_RK3
899#endif
900 use pm_kind, only: RKG => RK3
901 type(xoshiro256ssw_type), intent(inout) :: rng
902 integer(IK) , intent(in) :: ncls
903 real(RKG) , intent(in) , contiguous :: sample(:,:)
904 real(RKG) , intent(out) , contiguous :: disq(:)
905 integer(IK) , intent(out) , contiguous :: membership(:)
906 end subroutine
907#endif
908
909#if RK2_ENABLED
910 PURE module subroutine setKmeansPPDRNGX_RK2(rng, membership, disq, sample, ncls)
911#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
912 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGX_RK2
913#endif
914 use pm_kind, only: RKG => RK2
915 type(xoshiro256ssw_type), intent(inout) :: rng
916 integer(IK) , intent(in) :: ncls
917 real(RKG) , intent(in) , contiguous :: sample(:,:)
918 real(RKG) , intent(out) , contiguous :: disq(:)
919 integer(IK) , intent(out) , contiguous :: membership(:)
920 end subroutine
921#endif
922
923#if RK1_ENABLED
924 PURE module subroutine setKmeansPPDRNGX_RK1(rng, membership, disq, sample, ncls)
925#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
926 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPDRNGX_RK1
927#endif
928 use pm_kind, only: RKG => RK1
929 type(xoshiro256ssw_type), intent(inout) :: rng
930 integer(IK) , intent(in) :: ncls
931 real(RKG) , intent(in) , contiguous :: sample(:,:)
932 real(RKG) , intent(out) , contiguous :: disq(:)
933 integer(IK) , intent(out) , contiguous :: membership(:)
934 end subroutine
935#endif
936
937 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
938
939 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
940 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
941 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
942
943 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
944
945#if RK5_ENABLED
946 impure module subroutine setKmeansPPORNGF_RK5(rng, membership, disq, sample, center, size, potential)
947#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
948 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGF_RK5
949#endif
950 use pm_kind, only: RKG => RK5
951 type(rngf_type) , intent(in) :: rng
952 real(RKG) , intent(in) , contiguous :: sample(:,:)
953 real(RKG) , intent(out) , contiguous :: disq(:)
954 real(RKG) , intent(out) , contiguous :: center(:,:)
955 real(RKG) , intent(out) , contiguous :: potential(:)
956 integer(IK) , intent(out) , contiguous :: membership(:)
957 integer(IK) , intent(out) , contiguous :: size(:)
958 end subroutine
959#endif
960
961#if RK4_ENABLED
962 impure module subroutine setKmeansPPORNGF_RK4(rng, membership, disq, sample, center, size, potential)
963#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
964 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGF_RK4
965#endif
966 use pm_kind, only: RKG => RK4
967 type(rngf_type) , intent(in) :: rng
968 real(RKG) , intent(in) , contiguous :: sample(:,:)
969 real(RKG) , intent(out) , contiguous :: disq(:)
970 real(RKG) , intent(out) , contiguous :: center(:,:)
971 real(RKG) , intent(out) , contiguous :: potential(:)
972 integer(IK) , intent(out) , contiguous :: membership(:)
973 integer(IK) , intent(out) , contiguous :: size(:)
974 end subroutine
975#endif
976
977#if RK3_ENABLED
978 impure module subroutine setKmeansPPORNGF_RK3(rng, membership, disq, sample, center, size, potential)
979#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
980 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGF_RK3
981#endif
982 use pm_kind, only: RKG => RK3
983 type(rngf_type) , intent(in) :: rng
984 real(RKG) , intent(in) , contiguous :: sample(:,:)
985 real(RKG) , intent(out) , contiguous :: disq(:)
986 real(RKG) , intent(out) , contiguous :: center(:,:)
987 real(RKG) , intent(out) , contiguous :: potential(:)
988 integer(IK) , intent(out) , contiguous :: membership(:)
989 integer(IK) , intent(out) , contiguous :: size(:)
990 end subroutine
991#endif
992
993#if RK2_ENABLED
994 impure module subroutine setKmeansPPORNGF_RK2(rng, membership, disq, sample, center, size, potential)
995#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
996 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGF_RK2
997#endif
998 use pm_kind, only: RKG => RK2
999 type(rngf_type) , intent(in) :: rng
1000 real(RKG) , intent(in) , contiguous :: sample(:,:)
1001 real(RKG) , intent(out) , contiguous :: disq(:)
1002 real(RKG) , intent(out) , contiguous :: center(:,:)
1003 real(RKG) , intent(out) , contiguous :: potential(:)
1004 integer(IK) , intent(out) , contiguous :: membership(:)
1005 integer(IK) , intent(out) , contiguous :: size(:)
1006 end subroutine
1007#endif
1008
1009#if RK1_ENABLED
1010 impure module subroutine setKmeansPPORNGF_RK1(rng, membership, disq, sample, center, size, potential)
1011#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1012 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGF_RK1
1013#endif
1014 use pm_kind, only: RKG => RK1
1015 type(rngf_type) , intent(in) :: rng
1016 real(RKG) , intent(in) , contiguous :: sample(:,:)
1017 real(RKG) , intent(out) , contiguous :: disq(:)
1018 real(RKG) , intent(out) , contiguous :: center(:,:)
1019 real(RKG) , intent(out) , contiguous :: potential(:)
1020 integer(IK) , intent(out) , contiguous :: membership(:)
1021 integer(IK) , intent(out) , contiguous :: size(:)
1022 end subroutine
1023#endif
1024
1025 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1026
1027#if RK5_ENABLED
1028 PURE module subroutine setKmeansPPORNGX_RK5(rng, membership, disq, sample, center, size, potential)
1029#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1030 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGX_RK5
1031#endif
1032 use pm_kind, only: RKG => RK5
1033 type(xoshiro256ssw_type), intent(inout) :: rng
1034 real(RKG) , intent(in) , contiguous :: sample(:,:)
1035 real(RKG) , intent(out) , contiguous :: disq(:)
1036 real(RKG) , intent(out) , contiguous :: center(:,:)
1037 real(RKG) , intent(out) , contiguous :: potential(:)
1038 integer(IK) , intent(out) , contiguous :: membership(:)
1039 integer(IK) , intent(out) , contiguous :: size(:)
1040 end subroutine
1041#endif
1042
1043#if RK4_ENABLED
1044 PURE module subroutine setKmeansPPORNGX_RK4(rng, membership, disq, sample, center, size, potential)
1045#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1046 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGX_RK4
1047#endif
1048 use pm_kind, only: RKG => RK4
1049 type(xoshiro256ssw_type), intent(inout) :: rng
1050 real(RKG) , intent(in) , contiguous :: sample(:,:)
1051 real(RKG) , intent(out) , contiguous :: disq(:)
1052 real(RKG) , intent(out) , contiguous :: center(:,:)
1053 real(RKG) , intent(out) , contiguous :: potential(:)
1054 integer(IK) , intent(out) , contiguous :: membership(:)
1055 integer(IK) , intent(out) , contiguous :: size(:)
1056 end subroutine
1057#endif
1058
1059#if RK3_ENABLED
1060 PURE module subroutine setKmeansPPORNGX_RK3(rng, membership, disq, sample, center, size, potential)
1061#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1062 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGX_RK3
1063#endif
1064 use pm_kind, only: RKG => RK3
1065 type(xoshiro256ssw_type), intent(inout) :: rng
1066 real(RKG) , intent(in) , contiguous :: sample(:,:)
1067 real(RKG) , intent(out) , contiguous :: disq(:)
1068 real(RKG) , intent(out) , contiguous :: center(:,:)
1069 real(RKG) , intent(out) , contiguous :: potential(:)
1070 integer(IK) , intent(out) , contiguous :: membership(:)
1071 integer(IK) , intent(out) , contiguous :: size(:)
1072 end subroutine
1073#endif
1074
1075#if RK2_ENABLED
1076 PURE module subroutine setKmeansPPORNGX_RK2(rng, membership, disq, sample, center, size, potential)
1077#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1078 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGX_RK2
1079#endif
1080 use pm_kind, only: RKG => RK2
1081 type(xoshiro256ssw_type), intent(inout) :: rng
1082 real(RKG) , intent(in) , contiguous :: sample(:,:)
1083 real(RKG) , intent(out) , contiguous :: disq(:)
1084 real(RKG) , intent(out) , contiguous :: center(:,:)
1085 real(RKG) , intent(out) , contiguous :: potential(:)
1086 integer(IK) , intent(out) , contiguous :: membership(:)
1087 integer(IK) , intent(out) , contiguous :: size(:)
1088 end subroutine
1089#endif
1090
1091#if RK1_ENABLED
1092 PURE module subroutine setKmeansPPORNGX_RK1(rng, membership, disq, sample, center, size, potential)
1093#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1094 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansPPORNGX_RK1
1095#endif
1096 use pm_kind, only: RKG => RK1
1097 type(xoshiro256ssw_type), intent(inout) :: rng
1098 real(RKG) , intent(in) , contiguous :: sample(:,:)
1099 real(RKG) , intent(out) , contiguous :: disq(:)
1100 real(RKG) , intent(out) , contiguous :: center(:,:)
1101 real(RKG) , intent(out) , contiguous :: potential(:)
1102 integer(IK) , intent(out) , contiguous :: membership(:)
1103 integer(IK) , intent(out) , contiguous :: size(:)
1104 end subroutine
1105#endif
1106
1107 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1108
1109 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1110 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112
1113 end interface
1114
1115!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1116
1292 interface setKmeans
1293
1294 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1295 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1296 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1297
1298 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1299
1300#if RK5_ENABLED
1301 PURE module subroutine setKmeansInit_RK5(membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize)
1302#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1303 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansInit_RK5
1304#endif
1305 use pm_kind, only: RKG => RK5
1306 integer(IK) , intent(in) , optional :: minsize
1307 integer(IK) , intent(in) , optional :: maxniter
1308 real(RKG) , intent(in) , contiguous :: sample(:,:)
1309 real(RKG) , intent(inout) , contiguous :: disq(:)
1310 real(RKG) , intent(inout) , contiguous :: center(:,:)
1311 real(RKG) , intent(inout) , contiguous :: potential(:)
1312 integer(IK) , intent(inout) , contiguous :: membership(:)
1313 integer(IK) , intent(inout) , contiguous :: size(:)
1314 integer(IK) , intent(out) , optional :: niter
1315 logical(LK) , intent(out) :: failed
1316 end subroutine
1317#endif
1318
1319#if RK4_ENABLED
1320 PURE module subroutine setKmeansInit_RK4(membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize)
1321#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1322 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansInit_RK4
1323#endif
1324 use pm_kind, only: RKG => RK4
1325 integer(IK) , intent(in) , optional :: minsize
1326 integer(IK) , intent(in) , optional :: maxniter
1327 real(RKG) , intent(in) , contiguous :: sample(:,:)
1328 real(RKG) , intent(inout) , contiguous :: disq(:)
1329 real(RKG) , intent(inout) , contiguous :: center(:,:)
1330 real(RKG) , intent(inout) , contiguous :: potential(:)
1331 integer(IK) , intent(inout) , contiguous :: membership(:)
1332 integer(IK) , intent(inout) , contiguous :: size(:)
1333 integer(IK) , intent(out) , optional :: niter
1334 logical(LK) , intent(out) :: failed
1335 end subroutine
1336#endif
1337
1338#if RK3_ENABLED
1339 PURE module subroutine setKmeansInit_RK3(membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize)
1340#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1341 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansInit_RK3
1342#endif
1343 use pm_kind, only: RKG => RK3
1344 integer(IK) , intent(in) , optional :: minsize
1345 integer(IK) , intent(in) , optional :: maxniter
1346 real(RKG) , intent(in) , contiguous :: sample(:,:)
1347 real(RKG) , intent(inout) , contiguous :: disq(:)
1348 real(RKG) , intent(inout) , contiguous :: center(:,:)
1349 real(RKG) , intent(inout) , contiguous :: potential(:)
1350 integer(IK) , intent(inout) , contiguous :: membership(:)
1351 integer(IK) , intent(inout) , contiguous :: size(:)
1352 integer(IK) , intent(out) , optional :: niter
1353 logical(LK) , intent(out) :: failed
1354 end subroutine
1355#endif
1356
1357#if RK2_ENABLED
1358 PURE module subroutine setKmeansInit_RK2(membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize)
1359#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1360 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansInit_RK2
1361#endif
1362 use pm_kind, only: RKG => RK2
1363 integer(IK) , intent(in) , optional :: minsize
1364 integer(IK) , intent(in) , optional :: maxniter
1365 real(RKG) , intent(in) , contiguous :: sample(:,:)
1366 real(RKG) , intent(inout) , contiguous :: disq(:)
1367 real(RKG) , intent(inout) , contiguous :: center(:,:)
1368 real(RKG) , intent(inout) , contiguous :: potential(:)
1369 integer(IK) , intent(inout) , contiguous :: membership(:)
1370 integer(IK) , intent(inout) , contiguous :: size(:)
1371 integer(IK) , intent(out) , optional :: niter
1372 logical(LK) , intent(out) :: failed
1373 end subroutine
1374#endif
1375
1376#if RK1_ENABLED
1377 PURE module subroutine setKmeansInit_RK1(membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize)
1378#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1379 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansInit_RK1
1380#endif
1381 use pm_kind, only: RKG => RK1
1382 integer(IK) , intent(in) , optional :: minsize
1383 integer(IK) , intent(in) , optional :: maxniter
1384 real(RKG) , intent(in) , contiguous :: sample(:,:)
1385 real(RKG) , intent(inout) , contiguous :: disq(:)
1386 real(RKG) , intent(inout) , contiguous :: center(:,:)
1387 real(RKG) , intent(inout) , contiguous :: potential(:)
1388 integer(IK) , intent(inout) , contiguous :: membership(:)
1389 integer(IK) , intent(inout) , contiguous :: size(:)
1390 integer(IK) , intent(out) , optional :: niter
1391 logical(LK) , intent(out) :: failed
1392 end subroutine
1393#endif
1394
1395 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1396
1397#if RK5_ENABLED
1398 impure module subroutine setKmeansRNGF_RK5(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1399#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1400 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGF_RK5
1401#endif
1402 use pm_kind, only: RKG => RK5
1403 type(rngf_type) , intent(in) :: rng
1404 integer(IK) , intent(in) , optional :: minsize
1405 integer(IK) , intent(in) , optional :: maxniter
1406 integer(IK) , intent(in) , optional :: nfail
1407 real(RKG) , intent(in) , contiguous :: sample(:,:)
1408 real(RKG) , intent(out) , contiguous :: disq(:)
1409 real(RKG) , intent(out) , contiguous :: center(:,:)
1410 real(RKG) , intent(out) , contiguous :: potential(:)
1411 integer(IK) , intent(out) , contiguous :: membership(:)
1412 integer(IK) , intent(out) , contiguous :: size(:)
1413 integer(IK) , intent(out) , optional :: niter
1414 logical(LK) , intent(out) :: failed
1415 end subroutine
1416#endif
1417
1418#if RK4_ENABLED
1419 impure module subroutine setKmeansRNGF_RK4(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1420#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1421 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGF_RK4
1422#endif
1423 use pm_kind, only: RKG => RK4
1424 type(rngf_type) , intent(in) :: rng
1425 integer(IK) , intent(in) , optional :: minsize
1426 integer(IK) , intent(in) , optional :: maxniter
1427 integer(IK) , intent(in) , optional :: nfail
1428 real(RKG) , intent(in) , contiguous :: sample(:,:)
1429 real(RKG) , intent(out) , contiguous :: disq(:)
1430 real(RKG) , intent(out) , contiguous :: center(:,:)
1431 real(RKG) , intent(out) , contiguous :: potential(:)
1432 integer(IK) , intent(out) , contiguous :: membership(:)
1433 integer(IK) , intent(out) , contiguous :: size(:)
1434 integer(IK) , intent(out) , optional :: niter
1435 logical(LK) , intent(out) :: failed
1436 end subroutine
1437#endif
1438
1439#if RK3_ENABLED
1440 impure module subroutine setKmeansRNGF_RK3(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1441#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1442 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGF_RK3
1443#endif
1444 use pm_kind, only: RKG => RK3
1445 type(rngf_type) , intent(in) :: rng
1446 integer(IK) , intent(in) , optional :: minsize
1447 integer(IK) , intent(in) , optional :: maxniter
1448 integer(IK) , intent(in) , optional :: nfail
1449 real(RKG) , intent(in) , contiguous :: sample(:,:)
1450 real(RKG) , intent(out) , contiguous :: disq(:)
1451 real(RKG) , intent(out) , contiguous :: center(:,:)
1452 real(RKG) , intent(out) , contiguous :: potential(:)
1453 integer(IK) , intent(out) , contiguous :: membership(:)
1454 integer(IK) , intent(out) , contiguous :: size(:)
1455 integer(IK) , intent(out) , optional :: niter
1456 logical(LK) , intent(out) :: failed
1457 end subroutine
1458#endif
1459
1460#if RK2_ENABLED
1461 impure module subroutine setKmeansRNGF_RK2(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1462#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1463 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGF_RK2
1464#endif
1465 use pm_kind, only: RKG => RK2
1466 type(rngf_type) , intent(in) :: rng
1467 integer(IK) , intent(in) , optional :: minsize
1468 integer(IK) , intent(in) , optional :: maxniter
1469 integer(IK) , intent(in) , optional :: nfail
1470 real(RKG) , intent(in) , contiguous :: sample(:,:)
1471 real(RKG) , intent(out) , contiguous :: disq(:)
1472 real(RKG) , intent(out) , contiguous :: center(:,:)
1473 real(RKG) , intent(out) , contiguous :: potential(:)
1474 integer(IK) , intent(out) , contiguous :: membership(:)
1475 integer(IK) , intent(out) , contiguous :: size(:)
1476 integer(IK) , intent(out) , optional :: niter
1477 logical(LK) , intent(out) :: failed
1478 end subroutine
1479#endif
1480
1481#if RK1_ENABLED
1482 impure module subroutine setKmeansRNGF_RK1(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1483#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1484 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGF_RK1
1485#endif
1486 use pm_kind, only: RKG => RK1
1487 type(rngf_type) , intent(in) :: rng
1488 integer(IK) , intent(in) , optional :: minsize
1489 integer(IK) , intent(in) , optional :: maxniter
1490 integer(IK) , intent(in) , optional :: nfail
1491 real(RKG) , intent(in) , contiguous :: sample(:,:)
1492 real(RKG) , intent(out) , contiguous :: disq(:)
1493 real(RKG) , intent(out) , contiguous :: center(:,:)
1494 real(RKG) , intent(out) , contiguous :: potential(:)
1495 integer(IK) , intent(out) , contiguous :: membership(:)
1496 integer(IK) , intent(out) , contiguous :: size(:)
1497 integer(IK) , intent(out) , optional :: niter
1498 logical(LK) , intent(out) :: failed
1499 end subroutine
1500#endif
1501
1502 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1503
1504#if RK5_ENABLED
1505 PURE module subroutine setKmeansRNGX_RK5(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1506#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1507 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGX_RK5
1508#endif
1509 use pm_kind, only: RKG => RK5
1510 type(xoshiro256ssw_type), intent(inout) :: rng
1511 integer(IK) , intent(in) , optional :: minsize
1512 integer(IK) , intent(in) , optional :: maxniter
1513 integer(IK) , intent(in) , optional :: nfail
1514 real(RKG) , intent(in) , contiguous :: sample(:,:)
1515 real(RKG) , intent(out) , contiguous :: disq(:)
1516 real(RKG) , intent(out) , contiguous :: center(:,:)
1517 real(RKG) , intent(out) , contiguous :: potential(:)
1518 integer(IK) , intent(out) , contiguous :: membership(:)
1519 integer(IK) , intent(out) , contiguous :: size(:)
1520 integer(IK) , intent(out) , optional :: niter
1521 logical(LK) , intent(out) :: failed
1522 end subroutine
1523#endif
1524
1525#if RK4_ENABLED
1526 PURE module subroutine setKmeansRNGX_RK4(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1527#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1528 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGX_RK4
1529#endif
1530 use pm_kind, only: RKG => RK4
1531 type(xoshiro256ssw_type), intent(inout) :: rng
1532 integer(IK) , intent(in) , optional :: minsize
1533 integer(IK) , intent(in) , optional :: maxniter
1534 integer(IK) , intent(in) , optional :: nfail
1535 real(RKG) , intent(in) , contiguous :: sample(:,:)
1536 real(RKG) , intent(out) , contiguous :: disq(:)
1537 real(RKG) , intent(out) , contiguous :: center(:,:)
1538 real(RKG) , intent(out) , contiguous :: potential(:)
1539 integer(IK) , intent(out) , contiguous :: membership(:)
1540 integer(IK) , intent(out) , contiguous :: size(:)
1541 integer(IK) , intent(out) , optional :: niter
1542 logical(LK) , intent(out) :: failed
1543 end subroutine
1544#endif
1545
1546#if RK3_ENABLED
1547 PURE module subroutine setKmeansRNGX_RK3(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1548#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1549 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGX_RK3
1550#endif
1551 use pm_kind, only: RKG => RK3
1552 type(xoshiro256ssw_type), intent(inout) :: rng
1553 integer(IK) , intent(in) , optional :: minsize
1554 integer(IK) , intent(in) , optional :: maxniter
1555 integer(IK) , intent(in) , optional :: nfail
1556 real(RKG) , intent(in) , contiguous :: sample(:,:)
1557 real(RKG) , intent(out) , contiguous :: disq(:)
1558 real(RKG) , intent(out) , contiguous :: center(:,:)
1559 real(RKG) , intent(out) , contiguous :: potential(:)
1560 integer(IK) , intent(out) , contiguous :: membership(:)
1561 integer(IK) , intent(out) , contiguous :: size(:)
1562 integer(IK) , intent(out) , optional :: niter
1563 logical(LK) , intent(out) :: failed
1564 end subroutine
1565#endif
1566
1567#if RK2_ENABLED
1568 PURE module subroutine setKmeansRNGX_RK2(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1569#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1570 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGX_RK2
1571#endif
1572 use pm_kind, only: RKG => RK2
1573 type(xoshiro256ssw_type), intent(inout) :: rng
1574 integer(IK) , intent(in) , optional :: minsize
1575 integer(IK) , intent(in) , optional :: maxniter
1576 integer(IK) , intent(in) , optional :: nfail
1577 real(RKG) , intent(in) , contiguous :: sample(:,:)
1578 real(RKG) , intent(out) , contiguous :: disq(:)
1579 real(RKG) , intent(out) , contiguous :: center(:,:)
1580 real(RKG) , intent(out) , contiguous :: potential(:)
1581 integer(IK) , intent(out) , contiguous :: membership(:)
1582 integer(IK) , intent(out) , contiguous :: size(:)
1583 integer(IK) , intent(out) , optional :: niter
1584 logical(LK) , intent(out) :: failed
1585 end subroutine
1586#endif
1587
1588#if RK1_ENABLED
1589 PURE module subroutine setKmeansRNGX_RK1(rng, membership, disq, sample, center, size, potential, failed, niter, maxniter, minsize, nfail)
1590#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1591 !DEC$ ATTRIBUTES DLLEXPORT :: setKmeansRNGX_RK1
1592#endif
1593 use pm_kind, only: RKG => RK1
1594 type(xoshiro256ssw_type), intent(inout) :: rng
1595 integer(IK) , intent(in) , optional :: minsize
1596 integer(IK) , intent(in) , optional :: maxniter
1597 integer(IK) , intent(in) , optional :: nfail
1598 real(RKG) , intent(in) , contiguous :: sample(:,:)
1599 real(RKG) , intent(out) , contiguous :: disq(:)
1600 real(RKG) , intent(out) , contiguous :: center(:,:)
1601 real(RKG) , intent(out) , contiguous :: potential(:)
1602 integer(IK) , intent(out) , contiguous :: membership(:)
1603 integer(IK) , intent(out) , contiguous :: size(:)
1604 integer(IK) , intent(out) , optional :: niter
1605 logical(LK) , intent(out) :: failed
1606 end subroutine
1607#endif
1608
1609 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1610
1611 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1612 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1613 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1614
1615 end interface
1616
1617!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1618
1619end module pm_clustering
Compute and return the centers of the clusters corresponding to the input sample, cluster membership ...
Compute and return an asymptotically optimal set of cluster centers for the input sample,...
Compute and return an iteratively-refined set of cluster centers given the input sample using the k-m...
Compute and return the memberships and minimum distances of a set of input points with respect to the...
This module contains procedures and routines for the computing the Kmeans clustering of a given set o...
character(*, SK), parameter MODULE_NAME
This module contains classes and procedures for computing various statistical quantities related to t...
type(rngf_type) rngf
The scalar constant object of type rngf_type whose presence signified the use of the Fortran intrinsi...
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK5
Definition: pm_kind.F90:478
integer, parameter RK4
Definition: pm_kind.F90:489
integer, parameter RK2
Definition: pm_kind.F90:511
integer, parameter RK3
Definition: pm_kind.F90:500
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RK1
Definition: pm_kind.F90:522
This is a concrete derived type whose instances can be used to define/request the default uniform ran...
This is the derived type for declaring and generating objects of type xoshiro256ssw_type containing a...