12 integer(IK) :: ndim, npnt, itry, ntry
= 5
13 type(display_type) :: disp
17 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
18 call disp%show(
"! Compute the distance matrix of a set of points.")
19 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
23 real(RKG),
allocatable :: distance(:,:), point(:,:)
26 call disp%show(
"ndim = getUnifRand(1, 3); npnt = getUnifRand(1, 7)")
30 call disp%show(
"point = getUnifRand(1, 10, ndim, npnt)")
34 call disp%show(
"call setResized(distance, [npnt, npnt])")
36 call disp%show(
"call setDisMatEuclid(distance, rdpack, uppLowDia, point, euclid)")
40 call disp%show(
"call setDisMatEuclid(distance(1:npnt-1, 1:npnt), rdpack, uppLow, point, euclid) ! drop the zero-valued diagonal elements of the distance matrix.")
42 call disp%show(
"distance(1:npnt-1, 1:npnt)")
43 call disp%show( distance(
1:npnt
-1,
1:npnt) )
44 call disp%show(
"call setDisMatEuclid(distance, rdpack, uppLowDia, point, euclidu)")
48 call disp%show(
"call setDisMatEuclid(distance(1:npnt-1, 1:npnt), rdpack, uppLow, point, euclidsq) ! drop the zero-valued diagonal elements of the distance matrix.")
50 call disp%show(
"distance(1:npnt-1, 1:npnt)")
51 call disp%show( distance(
1:npnt
-1,
1:npnt) )
52 call disp%show(
"call setDisMatEuclid(distance, rdpack, uppLowDia, point, euclidsq)")
56 call disp%show(
"call setDisMatEuclid(distance(1:npnt-1, 1:npnt), rdpack, uppLow, point, euclidsq) ! drop the zero-valued diagonal elements of the distance matrix.")
58 call disp%show(
"distance(1:npnt-1, 1:npnt)")
59 call disp%show( distance(
1:npnt
-1,
1:npnt) )
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains classes and procedures for computing various statistical quantities related to t...
type(euclidu_type), parameter euclidu
This is a scalar parameter object of type euclidu_typethat is exclusively used to request unsafe meth...
type(euclid_type), parameter euclid
This is a scalar parameter object of type euclid_type that is exclusively used to request safe method...
type(euclidsq_type), parameter euclidsq
This is a scalar parameter object of type euclidsq_typethat is exclusively used to request computing ...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Generate and return an object of type display_type.
12+4.00000000,
+8.00000000,
+9.00000000,
+10.0000000,
+8.00000000,
+9.00000000,
+10.0000000
13+6.00000000,
+10.0000000,
+5.00000000,
+2.00000000,
+3.00000000,
+2.00000000,
+3.00000000
17+0.00000000,
+5.65685415,
+5.09901953,
+7.21110249,
+5.00000000,
+6.40312433,
+6.70820427
18+5.65685415,
+0.00000000,
+5.09901953,
+8.24621105,
+7.00000000,
+8.06225777,
+7.28010988
19+5.09901953,
+5.09901953,
+0.00000000,
+3.16227770,
+2.23606801,
+3.00000000,
+2.23606801
20+7.21110249,
+8.24621105,
+3.16227770,
+0.00000000,
+2.23606801,
+1.00000000,
+1.00000000
21+5.00000000,
+7.00000000,
+2.23606801,
+2.23606801,
+0.00000000,
+1.41421354,
+2.00000000
22+6.40312433,
+8.06225777,
+3.00000000,
+1.00000000,
+1.41421354,
+0.00000000,
+1.41421354
23+6.70820427,
+7.28010988,
+2.23606801,
+1.00000000,
+2.00000000,
+1.41421354,
+0.00000000
25distance(
1:npnt
-1,
1:npnt)
26+5.65685415,
+5.65685415,
+5.09901953,
+7.21110249,
+5.00000000,
+6.40312433,
+6.70820427
27+5.09901953,
+5.09901953,
+5.09901953,
+8.24621105,
+7.00000000,
+8.06225777,
+7.28010988
28+7.21110249,
+8.24621105,
+3.16227770,
+3.16227770,
+2.23606801,
+3.00000000,
+2.23606801
29+5.00000000,
+7.00000000,
+2.23606801,
+2.23606801,
+2.23606801,
+1.00000000,
+1.00000000
30+6.40312433,
+8.06225777,
+3.00000000,
+1.00000000,
+1.41421354,
+1.41421354,
+2.00000000
31+6.70820427,
+7.28010988,
+2.23606801,
+1.00000000,
+2.00000000,
+1.41421354,
+1.41421354
34+0.00000000,
+5.65685415,
+5.09901953,
+7.21110249,
+5.00000000,
+6.40312433,
+6.70820379
35+5.65685415,
+0.00000000,
+5.09901953,
+8.24621105,
+7.00000000,
+8.06225777,
+7.28010988
36+5.09901953,
+5.09901953,
+0.00000000,
+3.16227770,
+2.23606801,
+3.00000000,
+2.23606801
37+7.21110249,
+8.24621105,
+3.16227770,
+0.00000000,
+2.23606801,
+1.00000000,
+1.00000000
38+5.00000000,
+7.00000000,
+2.23606801,
+2.23606801,
+0.00000000,
+1.41421354,
+2.00000000
39+6.40312433,
+8.06225777,
+3.00000000,
+1.00000000,
+1.41421354,
+0.00000000,
+1.41421354
40+6.70820379,
+7.28010988,
+2.23606801,
+1.00000000,
+2.00000000,
+1.41421354,
+0.00000000
42distance(
1:npnt
-1,
1:npnt)
43+32.0000000,
+32.0000000,
+26.0000000,
+52.0000000,
+25.0000000,
+41.0000000,
+45.0000000
44+26.0000000,
+26.0000000,
+26.0000000,
+68.0000000,
+49.0000000,
+65.0000000,
+53.0000000
45+52.0000000,
+68.0000000,
+10.0000000,
+10.0000000,
+5.00000000,
+9.00000000,
+5.00000000
46+25.0000000,
+49.0000000,
+5.00000000,
+5.00000000,
+5.00000000,
+1.00000000,
+1.00000000
47+41.0000000,
+65.0000000,
+9.00000000,
+1.00000000,
+2.00000000,
+2.00000000,
+4.00000000
48+45.0000000,
+53.0000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000,
+2.00000000
51+0.00000000,
+32.0000000,
+26.0000000,
+52.0000000,
+25.0000000,
+41.0000000,
+45.0000000
52+32.0000000,
+0.00000000,
+26.0000000,
+68.0000000,
+49.0000000,
+65.0000000,
+53.0000000
53+26.0000000,
+26.0000000,
+0.00000000,
+10.0000000,
+5.00000000,
+9.00000000,
+5.00000000
54+52.0000000,
+68.0000000,
+10.0000000,
+0.00000000,
+5.00000000,
+1.00000000,
+1.00000000
55+25.0000000,
+49.0000000,
+5.00000000,
+5.00000000,
+0.00000000,
+2.00000000,
+4.00000000
56+41.0000000,
+65.0000000,
+9.00000000,
+1.00000000,
+2.00000000,
+0.00000000,
+2.00000000
57+45.0000000,
+53.0000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000,
+0.00000000
59distance(
1:npnt
-1,
1:npnt)
60+32.0000000,
+32.0000000,
+26.0000000,
+52.0000000,
+25.0000000,
+41.0000000,
+45.0000000
61+26.0000000,
+26.0000000,
+26.0000000,
+68.0000000,
+49.0000000,
+65.0000000,
+53.0000000
62+52.0000000,
+68.0000000,
+10.0000000,
+10.0000000,
+5.00000000,
+9.00000000,
+5.00000000
63+25.0000000,
+49.0000000,
+5.00000000,
+5.00000000,
+5.00000000,
+1.00000000,
+1.00000000
64+41.0000000,
+65.0000000,
+9.00000000,
+1.00000000,
+2.00000000,
+2.00000000,
+4.00000000
65+45.0000000,
+53.0000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000,
+2.00000000
73+9.00000000,
+3.00000000
74+8.00000000,
+7.00000000
75+7.00000000,
+10.0000000
79+0.00000000,
+6.78233051
80+6.78233051,
+0.00000000
82distance(
1:npnt
-1,
1:npnt)
83+6.78233051,
+6.78233051
86+0.00000000,
+6.78233004
87+6.78233004,
+0.00000000
89distance(
1:npnt
-1,
1:npnt)
90+46.0000000,
+46.0000000
93+0.00000000,
+46.0000000
94+46.0000000,
+0.00000000
96distance(
1:npnt
-1,
1:npnt)
97+46.0000000,
+46.0000000
105+10.0000000,
+10.0000000,
+4.00000000,
+7.00000000,
+9.00000000,
+5.00000000,
+6.00000000
106+7.00000000,
+9.00000000,
+7.00000000,
+2.00000000,
+8.00000000,
+7.00000000,
+3.00000000
110+0.00000000,
+2.00000000,
+6.00000000,
+5.83095169,
+1.41421354,
+5.00000000,
+5.65685415
111+2.00000000,
+0.00000000,
+6.32455540,
+7.61577320,
+1.41421354,
+5.38516474,
+7.21110249
112+6.00000000,
+6.32455540,
+0.00000000,
+5.83095169,
+5.09901953,
+1.00000000,
+4.47213602
113+5.83095169,
+7.61577320,
+5.83095169,
+0.00000000,
+6.32455540,
+5.38516474,
+1.41421354
114+1.41421354,
+1.41421354,
+5.09901953,
+6.32455540,
+0.00000000,
+4.12310553,
+5.83095169
115+5.00000000,
+5.38516474,
+1.00000000,
+5.38516474,
+4.12310553,
+0.00000000,
+4.12310553
116+5.65685415,
+7.21110249,
+4.47213602,
+1.41421354,
+5.83095169,
+4.12310553,
+0.00000000
118distance(
1:npnt
-1,
1:npnt)
119+2.00000000,
+2.00000000,
+6.00000000,
+5.83095169,
+1.41421354,
+5.00000000,
+5.65685415
120+6.00000000,
+6.32455540,
+6.32455540,
+7.61577320,
+1.41421354,
+5.38516474,
+7.21110249
121+5.83095169,
+7.61577320,
+5.83095169,
+5.83095169,
+5.09901953,
+1.00000000,
+4.47213602
122+1.41421354,
+1.41421354,
+5.09901953,
+6.32455540,
+6.32455540,
+5.38516474,
+1.41421354
123+5.00000000,
+5.38516474,
+1.00000000,
+5.38516474,
+4.12310553,
+4.12310553,
+5.83095169
124+5.65685415,
+7.21110249,
+4.47213602,
+1.41421354,
+5.83095169,
+4.12310553,
+4.12310553
127+0.00000000,
+2.00000000,
+6.00000000,
+5.83095169,
+1.41421354,
+5.00000000,
+5.65685415
128+2.00000000,
+0.00000000,
+6.32455540,
+7.61577320,
+1.41421354,
+5.38516474,
+7.21110249
129+6.00000000,
+6.32455540,
+0.00000000,
+5.83095169,
+5.09901953,
+1.00000000,
+4.47213602
130+5.83095169,
+7.61577320,
+5.83095169,
+0.00000000,
+6.32455540,
+5.38516474,
+1.41421354
131+1.41421354,
+1.41421354,
+5.09901953,
+6.32455540,
+0.00000000,
+4.12310553,
+5.83095169
132+5.00000000,
+5.38516474,
+1.00000000,
+5.38516474,
+4.12310553,
+0.00000000,
+4.12310553
133+5.65685415,
+7.21110249,
+4.47213602,
+1.41421354,
+5.83095169,
+4.12310553,
+0.00000000
135distance(
1:npnt
-1,
1:npnt)
136+4.00000000,
+4.00000000,
+36.0000000,
+34.0000000,
+2.00000000,
+25.0000000,
+32.0000000
137+36.0000000,
+40.0000000,
+40.0000000,
+58.0000000,
+2.00000000,
+29.0000000,
+52.0000000
138+34.0000000,
+58.0000000,
+34.0000000,
+34.0000000,
+26.0000000,
+1.00000000,
+20.0000000
139+2.00000000,
+2.00000000,
+26.0000000,
+40.0000000,
+40.0000000,
+29.0000000,
+2.00000000
140+25.0000000,
+29.0000000,
+1.00000000,
+29.0000000,
+17.0000000,
+17.0000000,
+34.0000000
141+32.0000000,
+52.0000000,
+20.0000000,
+2.00000000,
+34.0000000,
+17.0000000,
+17.0000000
144+0.00000000,
+4.00000000,
+36.0000000,
+34.0000000,
+2.00000000,
+25.0000000,
+32.0000000
145+4.00000000,
+0.00000000,
+40.0000000,
+58.0000000,
+2.00000000,
+29.0000000,
+52.0000000
146+36.0000000,
+40.0000000,
+0.00000000,
+34.0000000,
+26.0000000,
+1.00000000,
+20.0000000
147+34.0000000,
+58.0000000,
+34.0000000,
+0.00000000,
+40.0000000,
+29.0000000,
+2.00000000
148+2.00000000,
+2.00000000,
+26.0000000,
+40.0000000,
+0.00000000,
+17.0000000,
+34.0000000
149+25.0000000,
+29.0000000,
+1.00000000,
+29.0000000,
+17.0000000,
+0.00000000,
+17.0000000
150+32.0000000,
+52.0000000,
+20.0000000,
+2.00000000,
+34.0000000,
+17.0000000,
+0.00000000
152distance(
1:npnt
-1,
1:npnt)
153+4.00000000,
+4.00000000,
+36.0000000,
+34.0000000,
+2.00000000,
+25.0000000,
+32.0000000
154+36.0000000,
+40.0000000,
+40.0000000,
+58.0000000,
+2.00000000,
+29.0000000,
+52.0000000
155+34.0000000,
+58.0000000,
+34.0000000,
+34.0000000,
+26.0000000,
+1.00000000,
+20.0000000
156+2.00000000,
+2.00000000,
+26.0000000,
+40.0000000,
+40.0000000,
+29.0000000,
+2.00000000
157+25.0000000,
+29.0000000,
+1.00000000,
+29.0000000,
+17.0000000,
+17.0000000,
+34.0000000
158+32.0000000,
+52.0000000,
+20.0000000,
+2.00000000,
+34.0000000,
+17.0000000,
+17.0000000
166+2.00000000,
+6.00000000,
+4.00000000
167+6.00000000,
+1.00000000,
+1.00000000
168+8.00000000,
+10.0000000,
+6.00000000
172+0.00000000,
+6.70820427,
+5.74456263
173+6.70820427,
+0.00000000,
+4.47213602
174+5.74456263,
+4.47213602,
+0.00000000
176distance(
1:npnt
-1,
1:npnt)
177+6.70820427,
+6.70820427,
+5.74456263
178+5.74456263,
+4.47213602,
+4.47213602
181+0.00000000,
+6.70820379,
+5.74456263
182+6.70820379,
+0.00000000,
+4.47213602
183+5.74456263,
+4.47213602,
+0.00000000
185distance(
1:npnt
-1,
1:npnt)
186+45.0000000,
+45.0000000,
+33.0000000
187+33.0000000,
+20.0000000,
+20.0000000
190+0.00000000,
+45.0000000,
+33.0000000
191+45.0000000,
+0.00000000,
+20.0000000
192+33.0000000,
+20.0000000,
+0.00000000
194distance(
1:npnt
-1,
1:npnt)
195+45.0000000,
+45.0000000,
+33.0000000
196+33.0000000,
+20.0000000,
+20.0000000
204+10.0000000,
+8.00000000
205+10.0000000,
+4.00000000
206+10.0000000,
+8.00000000
210+0.00000000,
+6.63324928
211+6.63324928,
+0.00000000
213distance(
1:npnt
-1,
1:npnt)
214+6.63324928,
+6.63324928
217+0.00000000,
+6.63324976
218+6.63324976,
+0.00000000
220distance(
1:npnt
-1,
1:npnt)
221+44.0000000,
+44.0000000
224+0.00000000,
+44.0000000
225+44.0000000,
+0.00000000
227distance(
1:npnt
-1,
1:npnt)
228+44.0000000,
+44.0000000