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,
+10.0000000,
+10.0000000,
+4.00000000,
+3.00000000,
+1.00000000
16+0.00000000,
+6.00000000,
+6.00000000,
+0.00000000,
+1.00000000,
+3.00000000
17+6.00000000,
+0.00000000,
+0.00000000,
+6.00000000,
+7.00000000,
+9.00000000
18+6.00000000,
+0.00000000,
+0.00000000,
+6.00000000,
+7.00000000,
+9.00000000
19+0.00000000,
+6.00000000,
+6.00000000,
+0.00000000,
+1.00000000,
+3.00000000
20+1.00000000,
+7.00000000,
+7.00000000,
+1.00000000,
+0.00000000,
+2.00000000
21+3.00000000,
+9.00000000,
+9.00000000,
+3.00000000,
+2.00000000,
+0.00000000
23distance(
1:npnt
-1,
1:npnt)
24+6.00000000,
+6.00000000,
+6.00000000,
+0.00000000,
+1.00000000,
+3.00000000
25+6.00000000,
+0.00000000,
+0.00000000,
+6.00000000,
+7.00000000,
+9.00000000
26+0.00000000,
+6.00000000,
+6.00000000,
+6.00000000,
+7.00000000,
+9.00000000
27+1.00000000,
+7.00000000,
+7.00000000,
+1.00000000,
+1.00000000,
+3.00000000
28+3.00000000,
+9.00000000,
+9.00000000,
+3.00000000,
+2.00000000,
+2.00000000
31+0.00000000,
+6.00000000,
+6.00000000,
+0.00000000,
+1.00000000,
+3.00000000
32+6.00000000,
+0.00000000,
+0.00000000,
+6.00000000,
+7.00000000,
+9.00000000
33+6.00000000,
+0.00000000,
+0.00000000,
+6.00000000,
+7.00000000,
+9.00000000
34+0.00000000,
+6.00000000,
+6.00000000,
+0.00000000,
+1.00000000,
+3.00000000
35+1.00000000,
+7.00000000,
+7.00000000,
+1.00000000,
+0.00000000,
+2.00000000
36+3.00000000,
+9.00000000,
+9.00000000,
+3.00000000,
+2.00000000,
+0.00000000
38distance(
1:npnt
-1,
1:npnt)
39+36.0000000,
+36.0000000,
+36.0000000,
+0.00000000,
+1.00000000,
+9.00000000
40+36.0000000,
+0.00000000,
+0.00000000,
+36.0000000,
+49.0000000,
+81.0000000
41+0.00000000,
+36.0000000,
+36.0000000,
+36.0000000,
+49.0000000,
+81.0000000
42+1.00000000,
+49.0000000,
+49.0000000,
+1.00000000,
+1.00000000,
+9.00000000
43+9.00000000,
+81.0000000,
+81.0000000,
+9.00000000,
+4.00000000,
+4.00000000
46+0.00000000,
+36.0000000,
+36.0000000,
+0.00000000,
+1.00000000,
+9.00000000
47+36.0000000,
+0.00000000,
+0.00000000,
+36.0000000,
+49.0000000,
+81.0000000
48+36.0000000,
+0.00000000,
+0.00000000,
+36.0000000,
+49.0000000,
+81.0000000
49+0.00000000,
+36.0000000,
+36.0000000,
+0.00000000,
+1.00000000,
+9.00000000
50+1.00000000,
+49.0000000,
+49.0000000,
+1.00000000,
+0.00000000,
+4.00000000
51+9.00000000,
+81.0000000,
+81.0000000,
+9.00000000,
+4.00000000,
+0.00000000
53distance(
1:npnt
-1,
1:npnt)
54+36.0000000,
+36.0000000,
+36.0000000,
+0.00000000,
+1.00000000,
+9.00000000
55+36.0000000,
+0.00000000,
+0.00000000,
+36.0000000,
+49.0000000,
+81.0000000
56+0.00000000,
+36.0000000,
+36.0000000,
+36.0000000,
+49.0000000,
+81.0000000
57+1.00000000,
+49.0000000,
+49.0000000,
+1.00000000,
+1.00000000,
+9.00000000
58+9.00000000,
+81.0000000,
+81.0000000,
+9.00000000,
+4.00000000,
+4.00000000
74distance(
1:npnt
-1,
1:npnt)
79distance(
1:npnt
-1,
1:npnt)
84distance(
1:npnt
-1,
1:npnt)
92+2.00000000,
+2.00000000,
+4.00000000,
+6.00000000,
+8.00000000,
+1.00000000,
+2.00000000
93+3.00000000,
+4.00000000,
+4.00000000,
+1.00000000,
+8.00000000,
+3.00000000,
+9.00000000
97+0.00000000,
+1.00000000,
+2.23606801,
+4.47213602,
+7.81025028,
+1.00000000,
+6.00000000
98+1.00000000,
+0.00000000,
+2.00000000,
+5.00000000,
+7.21110249,
+1.41421354,
+5.00000000
99+2.23606801,
+2.00000000,
+0.00000000,
+3.60555124,
+5.65685415,
+3.16227770,
+5.38516474
100+4.47213602,
+5.00000000,
+3.60555124,
+0.00000000,
+7.28010988,
+5.38516474,
+8.94427204
101+7.81025028,
+7.21110249,
+5.65685415,
+7.28010988,
+0.00000000,
+8.60232544,
+6.08276224
102+1.00000000,
+1.41421354,
+3.16227770,
+5.38516474,
+8.60232544,
+0.00000000,
+6.08276224
103+6.00000000,
+5.00000000,
+5.38516474,
+8.94427204,
+6.08276224,
+6.08276224,
+0.00000000
105distance(
1:npnt
-1,
1:npnt)
106+1.00000000,
+1.00000000,
+2.23606801,
+4.47213602,
+7.81025028,
+1.00000000,
+6.00000000
107+2.23606801,
+2.00000000,
+2.00000000,
+5.00000000,
+7.21110249,
+1.41421354,
+5.00000000
108+4.47213602,
+5.00000000,
+3.60555124,
+3.60555124,
+5.65685415,
+3.16227770,
+5.38516474
109+7.81025028,
+7.21110249,
+5.65685415,
+7.28010988,
+7.28010988,
+5.38516474,
+8.94427204
110+1.00000000,
+1.41421354,
+3.16227770,
+5.38516474,
+8.60232544,
+8.60232544,
+6.08276224
111+6.00000000,
+5.00000000,
+5.38516474,
+8.94427204,
+6.08276224,
+6.08276224,
+6.08276224
114+0.00000000,
+1.00000000,
+2.23606801,
+4.47213602,
+7.81024981,
+1.00000000,
+6.00000000
115+1.00000000,
+0.00000000,
+2.00000000,
+5.00000000,
+7.21110249,
+1.41421354,
+5.00000000
116+2.23606801,
+2.00000000,
+0.00000000,
+3.60555124,
+5.65685415,
+3.16227770,
+5.38516474
117+4.47213602,
+5.00000000,
+3.60555124,
+0.00000000,
+7.28010988,
+5.38516474,
+8.94427204
118+7.81024981,
+7.21110249,
+5.65685415,
+7.28010988,
+0.00000000,
+8.60232544,
+6.08276272
119+1.00000000,
+1.41421354,
+3.16227770,
+5.38516474,
+8.60232544,
+0.00000000,
+6.08276272
120+6.00000000,
+5.00000000,
+5.38516474,
+8.94427204,
+6.08276272,
+6.08276272,
+0.00000000
122distance(
1:npnt
-1,
1:npnt)
123+1.00000000,
+1.00000000,
+5.00000000,
+20.0000000,
+61.0000000,
+1.00000000,
+36.0000000
124+5.00000000,
+4.00000000,
+4.00000000,
+25.0000000,
+52.0000000,
+2.00000000,
+25.0000000
125+20.0000000,
+25.0000000,
+13.0000000,
+13.0000000,
+32.0000000,
+10.0000000,
+29.0000000
126+61.0000000,
+52.0000000,
+32.0000000,
+53.0000000,
+53.0000000,
+29.0000000,
+80.0000000
127+1.00000000,
+2.00000000,
+10.0000000,
+29.0000000,
+74.0000000,
+74.0000000,
+37.0000000
128+36.0000000,
+25.0000000,
+29.0000000,
+80.0000000,
+37.0000000,
+37.0000000,
+37.0000000
131+0.00000000,
+1.00000000,
+5.00000000,
+20.0000000,
+61.0000000,
+1.00000000,
+36.0000000
132+1.00000000,
+0.00000000,
+4.00000000,
+25.0000000,
+52.0000000,
+2.00000000,
+25.0000000
133+5.00000000,
+4.00000000,
+0.00000000,
+13.0000000,
+32.0000000,
+10.0000000,
+29.0000000
134+20.0000000,
+25.0000000,
+13.0000000,
+0.00000000,
+53.0000000,
+29.0000000,
+80.0000000
135+61.0000000,
+52.0000000,
+32.0000000,
+53.0000000,
+0.00000000,
+74.0000000,
+37.0000000
136+1.00000000,
+2.00000000,
+10.0000000,
+29.0000000,
+74.0000000,
+0.00000000,
+37.0000000
137+36.0000000,
+25.0000000,
+29.0000000,
+80.0000000,
+37.0000000,
+37.0000000,
+0.00000000
139distance(
1:npnt
-1,
1:npnt)
140+1.00000000,
+1.00000000,
+5.00000000,
+20.0000000,
+61.0000000,
+1.00000000,
+36.0000000
141+5.00000000,
+4.00000000,
+4.00000000,
+25.0000000,
+52.0000000,
+2.00000000,
+25.0000000
142+20.0000000,
+25.0000000,
+13.0000000,
+13.0000000,
+32.0000000,
+10.0000000,
+29.0000000
143+61.0000000,
+52.0000000,
+32.0000000,
+53.0000000,
+53.0000000,
+29.0000000,
+80.0000000
144+1.00000000,
+2.00000000,
+10.0000000,
+29.0000000,
+74.0000000,
+74.0000000,
+37.0000000
145+36.0000000,
+25.0000000,
+29.0000000,
+80.0000000,
+37.0000000,
+37.0000000,
+37.0000000
153+10.0000000,
+1.00000000,
+5.00000000,
+1.00000000
154+5.00000000,
+5.00000000,
+3.00000000,
+1.00000000
158+0.00000000,
+9.00000000,
+5.38516474,
+9.84885788
159+9.00000000,
+0.00000000,
+4.47213602,
+4.00000000
160+5.38516474,
+4.47213602,
+0.00000000,
+4.47213602
161+9.84885788,
+4.00000000,
+4.47213602,
+0.00000000
163distance(
1:npnt
-1,
1:npnt)
164+9.00000000,
+9.00000000,
+5.38516474,
+9.84885788
165+5.38516474,
+4.47213602,
+4.47213602,
+4.00000000
166+9.84885788,
+4.00000000,
+4.47213602,
+4.47213602
169+0.00000000,
+9.00000000,
+5.38516474,
+9.84885788
170+9.00000000,
+0.00000000,
+4.47213602,
+4.00000000
171+5.38516474,
+4.47213602,
+0.00000000,
+4.47213602
172+9.84885788,
+4.00000000,
+4.47213602,
+0.00000000
174distance(
1:npnt
-1,
1:npnt)
175+81.0000000,
+81.0000000,
+29.0000000,
+97.0000000
176+29.0000000,
+20.0000000,
+20.0000000,
+16.0000000
177+97.0000000,
+16.0000000,
+20.0000000,
+20.0000000
180+0.00000000,
+81.0000000,
+29.0000000,
+97.0000000
181+81.0000000,
+0.00000000,
+20.0000000,
+16.0000000
182+29.0000000,
+20.0000000,
+0.00000000,
+20.0000000
183+97.0000000,
+16.0000000,
+20.0000000,
+0.00000000
185distance(
1:npnt
-1,
1:npnt)
186+81.0000000,
+81.0000000,
+29.0000000,
+97.0000000
187+29.0000000,
+20.0000000,
+20.0000000,
+16.0000000
188+97.0000000,
+16.0000000,
+20.0000000,
+20.0000000
196+4.00000000,
+9.00000000,
+5.00000000
197+4.00000000,
+7.00000000,
+2.00000000
198+5.00000000,
+8.00000000,
+1.00000000
202+0.00000000,
+6.55743837,
+4.58257580
203+6.55743837,
+0.00000000,
+9.48683357
204+4.58257580,
+9.48683357,
+0.00000000
206distance(
1:npnt
-1,
1:npnt)
207+6.55743837,
+6.55743837,
+4.58257580
208+4.58257580,
+9.48683357,
+9.48683357
211+0.00000000,
+6.55743837,
+4.58257580
212+6.55743837,
+0.00000000,
+9.48683262
213+4.58257580,
+9.48683262,
+0.00000000
215distance(
1:npnt
-1,
1:npnt)
216+43.0000000,
+43.0000000,
+21.0000000
217+21.0000000,
+90.0000000,
+90.0000000
220+0.00000000,
+43.0000000,
+21.0000000
221+43.0000000,
+0.00000000,
+90.0000000
222+21.0000000,
+90.0000000,
+0.00000000
224distance(
1:npnt
-1,
1:npnt)
225+43.0000000,
+43.0000000,
+21.0000000
226+21.0000000,
+90.0000000,
+90.0000000