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.
19distance(
1:npnt
-1,
1:npnt)
24distance(
1:npnt
-1,
1:npnt)
29distance(
1:npnt
-1,
1:npnt)
37+3.00000000,
+9.00000000,
+8.00000000,
+2.00000000,
+7.00000000,
+1.00000000
41+0.00000000,
+6.00000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000
42+6.00000000,
+0.00000000,
+1.00000000,
+7.00000000,
+2.00000000,
+8.00000000
43+5.00000000,
+1.00000000,
+0.00000000,
+6.00000000,
+1.00000000,
+7.00000000
44+1.00000000,
+7.00000000,
+6.00000000,
+0.00000000,
+5.00000000,
+1.00000000
45+4.00000000,
+2.00000000,
+1.00000000,
+5.00000000,
+0.00000000,
+6.00000000
46+2.00000000,
+8.00000000,
+7.00000000,
+1.00000000,
+6.00000000,
+0.00000000
48distance(
1:npnt
-1,
1:npnt)
49+6.00000000,
+6.00000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000
50+5.00000000,
+1.00000000,
+1.00000000,
+7.00000000,
+2.00000000,
+8.00000000
51+1.00000000,
+7.00000000,
+6.00000000,
+6.00000000,
+1.00000000,
+7.00000000
52+4.00000000,
+2.00000000,
+1.00000000,
+5.00000000,
+5.00000000,
+1.00000000
53+2.00000000,
+8.00000000,
+7.00000000,
+1.00000000,
+6.00000000,
+6.00000000
56+0.00000000,
+6.00000000,
+5.00000000,
+1.00000000,
+4.00000000,
+2.00000000
57+6.00000000,
+0.00000000,
+1.00000000,
+7.00000000,
+2.00000000,
+8.00000000
58+5.00000000,
+1.00000000,
+0.00000000,
+6.00000000,
+1.00000000,
+7.00000000
59+1.00000000,
+7.00000000,
+6.00000000,
+0.00000000,
+5.00000000,
+1.00000000
60+4.00000000,
+2.00000000,
+1.00000000,
+5.00000000,
+0.00000000,
+6.00000000
61+2.00000000,
+8.00000000,
+7.00000000,
+1.00000000,
+6.00000000,
+0.00000000
63distance(
1:npnt
-1,
1:npnt)
64+36.0000000,
+36.0000000,
+25.0000000,
+1.00000000,
+16.0000000,
+4.00000000
65+25.0000000,
+1.00000000,
+1.00000000,
+49.0000000,
+4.00000000,
+64.0000000
66+1.00000000,
+49.0000000,
+36.0000000,
+36.0000000,
+1.00000000,
+49.0000000
67+16.0000000,
+4.00000000,
+1.00000000,
+25.0000000,
+25.0000000,
+1.00000000
68+4.00000000,
+64.0000000,
+49.0000000,
+1.00000000,
+36.0000000,
+36.0000000
71+0.00000000,
+36.0000000,
+25.0000000,
+1.00000000,
+16.0000000,
+4.00000000
72+36.0000000,
+0.00000000,
+1.00000000,
+49.0000000,
+4.00000000,
+64.0000000
73+25.0000000,
+1.00000000,
+0.00000000,
+36.0000000,
+1.00000000,
+49.0000000
74+1.00000000,
+49.0000000,
+36.0000000,
+0.00000000,
+25.0000000,
+1.00000000
75+16.0000000,
+4.00000000,
+1.00000000,
+25.0000000,
+0.00000000,
+36.0000000
76+4.00000000,
+64.0000000,
+49.0000000,
+1.00000000,
+36.0000000,
+0.00000000
78distance(
1:npnt
-1,
1:npnt)
79+36.0000000,
+36.0000000,
+25.0000000,
+1.00000000,
+16.0000000,
+4.00000000
80+25.0000000,
+1.00000000,
+1.00000000,
+49.0000000,
+4.00000000,
+64.0000000
81+1.00000000,
+49.0000000,
+36.0000000,
+36.0000000,
+1.00000000,
+49.0000000
82+16.0000000,
+4.00000000,
+1.00000000,
+25.0000000,
+25.0000000,
+1.00000000
83+4.00000000,
+64.0000000,
+49.0000000,
+1.00000000,
+36.0000000,
+36.0000000
91+2.00000000,
+7.00000000,
+9.00000000,
+5.00000000,
+4.00000000
92+5.00000000,
+8.00000000,
+9.00000000,
+8.00000000,
+10.0000000
96+0.00000000,
+5.83095169,
+8.06225777,
+4.24264050,
+5.38516474
97+5.83095169,
+0.00000000,
+2.23606801,
+2.00000000,
+3.60555124
98+8.06225777,
+2.23606801,
+0.00000000,
+4.12310553,
+5.09901953
99+4.24264050,
+2.00000000,
+4.12310553,
+0.00000000,
+2.23606801
100+5.38516474,
+3.60555124,
+5.09901953,
+2.23606801,
+0.00000000
102distance(
1:npnt
-1,
1:npnt)
103+5.83095169,
+5.83095169,
+8.06225777,
+4.24264050,
+5.38516474
104+8.06225777,
+2.23606801,
+2.23606801,
+2.00000000,
+3.60555124
105+4.24264050,
+2.00000000,
+4.12310553,
+4.12310553,
+5.09901953
106+5.38516474,
+3.60555124,
+5.09901953,
+2.23606801,
+2.23606801
109+0.00000000,
+5.83095169,
+8.06225777,
+4.24264050,
+5.38516474
110+5.83095169,
+0.00000000,
+2.23606801,
+2.00000000,
+3.60555124
111+8.06225777,
+2.23606801,
+0.00000000,
+4.12310553,
+5.09901953
112+4.24264050,
+2.00000000,
+4.12310553,
+0.00000000,
+2.23606801
113+5.38516474,
+3.60555124,
+5.09901953,
+2.23606801,
+0.00000000
115distance(
1:npnt
-1,
1:npnt)
116+34.0000000,
+34.0000000,
+65.0000000,
+18.0000000,
+29.0000000
117+65.0000000,
+5.00000000,
+5.00000000,
+4.00000000,
+13.0000000
118+18.0000000,
+4.00000000,
+17.0000000,
+17.0000000,
+26.0000000
119+29.0000000,
+13.0000000,
+26.0000000,
+5.00000000,
+5.00000000
122+0.00000000,
+34.0000000,
+65.0000000,
+18.0000000,
+29.0000000
123+34.0000000,
+0.00000000,
+5.00000000,
+4.00000000,
+13.0000000
124+65.0000000,
+5.00000000,
+0.00000000,
+17.0000000,
+26.0000000
125+18.0000000,
+4.00000000,
+17.0000000,
+0.00000000,
+5.00000000
126+29.0000000,
+13.0000000,
+26.0000000,
+5.00000000,
+0.00000000
128distance(
1:npnt
-1,
1:npnt)
129+34.0000000,
+34.0000000,
+65.0000000,
+18.0000000,
+29.0000000
130+65.0000000,
+5.00000000,
+5.00000000,
+4.00000000,
+13.0000000
131+18.0000000,
+4.00000000,
+17.0000000,
+17.0000000,
+26.0000000
132+29.0000000,
+13.0000000,
+26.0000000,
+5.00000000,
+5.00000000
146distance(
1:npnt
-1,
1:npnt)
151distance(
1:npnt
-1,
1:npnt)
156distance(
1:npnt
-1,
1:npnt)
164+1.00000000,
+6.00000000,
+4.00000000,
+2.00000000,
+7.00000000,
+5.00000000
165+1.00000000,
+9.00000000,
+5.00000000,
+5.00000000,
+7.00000000,
+8.00000000
166+3.00000000,
+8.00000000,
+2.00000000,
+2.00000000,
+5.00000000,
+10.0000000
170+0.00000000,
+10.6770782,
+5.09901953,
+4.24264050,
+8.71779823,
+10.6770782
171+10.6770782,
+0.00000000,
+7.48331451,
+8.24621105,
+3.74165726,
+2.44948983
172+5.09901953,
+7.48331451,
+0.00000000,
+2.00000000,
+4.69041586,
+8.60232544
173+4.24264050,
+8.24621105,
+2.00000000,
+0.00000000,
+6.16441345,
+9.05538559
174+8.71779823,
+3.74165726,
+4.69041586,
+6.16441345,
+0.00000000,
+5.47722578
175+10.6770782,
+2.44948983,
+8.60232544,
+9.05538559,
+5.47722578,
+0.00000000
177distance(
1:npnt
-1,
1:npnt)
178+10.6770782,
+10.6770782,
+5.09901953,
+4.24264050,
+8.71779823,
+10.6770782
179+5.09901953,
+7.48331451,
+7.48331451,
+8.24621105,
+3.74165726,
+2.44948983
180+4.24264050,
+8.24621105,
+2.00000000,
+2.00000000,
+4.69041586,
+8.60232544
181+8.71779823,
+3.74165726,
+4.69041586,
+6.16441345,
+6.16441345,
+9.05538559
182+10.6770782,
+2.44948983,
+8.60232544,
+9.05538559,
+5.47722578,
+5.47722578
185+0.00000000,
+10.6770782,
+5.09901953,
+4.24264050,
+8.71779823,
+10.6770782
186+10.6770782,
+0.00000000,
+7.48331499,
+8.24621105,
+3.74165750,
+2.44948983
187+5.09901953,
+7.48331499,
+0.00000000,
+2.00000000,
+4.69041586,
+8.60232544
188+4.24264050,
+8.24621105,
+2.00000000,
+0.00000000,
+6.16441393,
+9.05538559
189+8.71779823,
+3.74165750,
+4.69041586,
+6.16441393,
+0.00000000,
+5.47722578
190+10.6770782,
+2.44948983,
+8.60232544,
+9.05538559,
+5.47722578,
+0.00000000
192distance(
1:npnt
-1,
1:npnt)
193+114.000000,
+114.000000,
+26.0000000,
+18.0000000,
+76.0000000,
+114.000000
194+26.0000000,
+56.0000000,
+56.0000000,
+68.0000000,
+14.0000000,
+6.00000000
195+18.0000000,
+68.0000000,
+4.00000000,
+4.00000000,
+22.0000000,
+74.0000000
196+76.0000000,
+14.0000000,
+22.0000000,
+38.0000000,
+38.0000000,
+82.0000000
197+114.000000,
+6.00000000,
+74.0000000,
+82.0000000,
+30.0000000,
+30.0000000
200+0.00000000,
+114.000000,
+26.0000000,
+18.0000000,
+76.0000000,
+114.000000
201+114.000000,
+0.00000000,
+56.0000000,
+68.0000000,
+14.0000000,
+6.00000000
202+26.0000000,
+56.0000000,
+0.00000000,
+4.00000000,
+22.0000000,
+74.0000000
203+18.0000000,
+68.0000000,
+4.00000000,
+0.00000000,
+38.0000000,
+82.0000000
204+76.0000000,
+14.0000000,
+22.0000000,
+38.0000000,
+0.00000000,
+30.0000000
205+114.000000,
+6.00000000,
+74.0000000,
+82.0000000,
+30.0000000,
+0.00000000
207distance(
1:npnt
-1,
1:npnt)
208+114.000000,
+114.000000,
+26.0000000,
+18.0000000,
+76.0000000,
+114.000000
209+26.0000000,
+56.0000000,
+56.0000000,
+68.0000000,
+14.0000000,
+6.00000000
210+18.0000000,
+68.0000000,
+4.00000000,
+4.00000000,
+22.0000000,
+74.0000000
211+76.0000000,
+14.0000000,
+22.0000000,
+38.0000000,
+38.0000000,
+82.0000000
212+114.000000,
+6.00000000,
+74.0000000,
+82.0000000,
+30.0000000,
+30.0000000