Return the input distance matrix whose columns are sorted in ascending order on output, optionally only up to the k
th row of each column, such that the k
th row in the i
th column is the k
th nearest neighbor to the \(i^{th}\) reference point.
More...
Return the input distance matrix whose columns are sorted in ascending order on output, optionally only up to the k
th row of each column, such that the k
th row in the i
th column is the k
th nearest neighbor to the \(i^{th}\) reference point.
The input matrix of shape (1:npnt, 1:nref)
represents the distances of nref
reference points from npnt
neighbor points.
The matrix entries can be any measure of distance as long they are non-negative.
- Parameters
-
[in,out] | distance | : The input or input/output contiguous array of rank 2 of shape (1:npnt, 1:nref) of
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128).
each column i of which contains the distances of npnt neighbor points stored by the column rows from the i th reference point.
For example, such distance matrix can be obtained via:
-
getDisMatEuclid or setDisMatEuclid
or any other distance metric module of the library.
-
If the input argument
rank is missing, then distance has intent(inout) .
On output, the rows of each column of distance are sorted separately in ascending order such that the k th row in column i contains the distance of the k th nearest neighbor of reference(1:ndim, i) represented by column distance(1:npnt, i) .
-
If the input argument
rank is present, then distance has intent(in) .
On output, the rows of each column of rank are filled with the rank of the corresponding element of distance ranked by its nearness to the reference represented by column distance(1:npnt, i) .
|
[out] | rank | : The output contiguous array of the same rank and shape as distance of type integer of default kind IK each element of which contains the nearest neighbor rank of the corresponding element of distance .
The neighborhood ranking is with respect to the point represented by the column of the element.
(optional. It can be present if and only if the input argument k is missing.) |
[in] | k | : The output scalar integer of default kind IK, representing the row in each column of distance up to which the distances in each column will be sorted in ascending order.
The rest of the rows beyond the k th row remain unsorted.
This argument is useful when sorting the entire distance matrix or computing the entire rank matrix is unnecessary.
(optional, default = size(distance, 1) . It can be present if and only if the input argument rank is missing.) |
Possible calling interfaces ⛓
call setKnnSorted(distance(
1:npnt,
1:nref),
rank(
1:npnt,
1:nref))
Return the input distance matrix whose columns are sorted in ascending order on output,...
This module contains procedures and generic interfaces for computing the nearest neighbor statistics ...
- Warning
- The condition
all(shape(distance) == shape(rank))
must hold for the corresponding input arguments.
The condition 0 < k .and. k <= size(distance, 1)
must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- Note
- To sort the neighbors of an individual point (corresponding to a single column vector), use the generic interfaces of pm_arrayRank or pm_arraySort.
- See also
- getDisEuclid
setDisEuclid
getDisMatEuclid
setDisMatEuclid
Example usage ⛓
12 integer(IK) :: npnt, nref, itry, ntry
= 5
13 type(display_type) :: disp
17 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
18 call disp%show(
"! Sort a precomputed distance matrix according to the nearest neighbors.")
19 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
24 integer(IK),
allocatable ::
rank(:,:)
25 real(RKG),
allocatable :: dismat(:,:), point(:,:)
28 call disp%show(
"npnt = getUnifRand(1, 3); nref = getUnifRand(5, 7)")
32 call disp%show(
"point = getUnifRand(1._RKG, 2._RKG, npnt, nref)")
36 call disp%show(
"dismat = getDisMatEuclid(point)")
40 call disp%show(
"call setKnnSorted(dismat, k = 1)")
44 call disp%show(
"call setKnnSorted(dismat, k = 2)")
48 call disp%show(
"dismat = getDisMatEuclid(point)")
52 call disp%show(
"call setResized(rank, shape(dismat))")
54 call disp%show(
"call setKnnSorted(dismat, rank)")
61 call disp%show(
"dismat = getDisMatEuclid(rdpack, uppLow, point) ! drop the zero-valued diagonal elements of the dismat matrix.")
65 call disp%show(
"call setKnnSorted(dismat, k = 1)")
69 call disp%show(
"dismat = getDisMatEuclid(rdpack, uppLow, point) ! drop the zero-valued diagonal elements of the dismat matrix.")
73 call disp%show(
"call setResized(rank, shape(dismat))")
75 call disp%show(
"call setKnnSorted(dismat, rank)")
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...
Return the full or a subset of the Euclidean (squared) distance matrix of the input set of npnt point...
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...
This module contains procedures and generic interfaces for computing the Euclidean norm of a single p...
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.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
12+1.83003092,
+1.26690674,
+1.09465182,
+1.33559465,
+1.15017366,
+1.24838042
13+1.01995254,
+1.61507702,
+1.08069932,
+1.82644153,
+1.44732261,
+1.18508375
14+1.23188114,
+1.90583205,
+1.03020942,
+1.18999219,
+1.10574937,
+1.53930306
17+0.00000000,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
18+1.06089199,
+0.00000000,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
19+0.764947057,
+1.04016650,
+0.00000000,
+0.799822092,
+0.378419876,
+0.541945457
20+0.946914136,
+0.749546349,
+0.799822092,
+0.00000000,
+0.430359095,
+0.735502720
21+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.00000000,
+0.516122639
22+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.00000000
25+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
26+0.678302169,
+0.565314949,
+0.378419876,
+0.430359095,
+0.378419876,
+0.516122639
27+1.06089199,
+0.749546349,
+0.541945457,
+0.749546349,
+0.430359095,
+0.541945457
28+0.946914136,
+0.825772583,
+0.799822092,
+0.735502720,
+0.516122639,
+0.735502720
29+0.812871635,
+1.04016650,
+1.04016650,
+0.799822092,
+0.825772583,
+0.565314949
30+0.764947057,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
33+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
34+0.678302169,
+0.565314949,
+0.378419876,
+0.430359095,
+0.378419876,
+0.516122639
35+0.764947057,
+0.749546349,
+0.541945457,
+0.735502720,
+0.430359095,
+0.541945457
36+0.946914136,
+0.825772583,
+0.799822092,
+0.749546349,
+0.516122639,
+0.735502720
37+0.812871635,
+1.04016650,
+1.04016650,
+0.799822092,
+0.825772583,
+0.565314949
38+1.06089199,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
41+0.00000000,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
42+1.06089199,
+0.00000000,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
43+0.764947057,
+1.04016650,
+0.00000000,
+0.799822092,
+0.378419876,
+0.541945457
44+0.946914136,
+0.749546349,
+0.799822092,
+0.00000000,
+0.430359095,
+0.735502720
45+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.00000000,
+0.516122639
46+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.00000000
50+0.00000000,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
51+1.06089199,
+0.00000000,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
52+0.764947057,
+1.04016650,
+0.00000000,
+0.799822092,
+0.378419876,
+0.541945457
53+0.946914136,
+0.749546349,
+0.799822092,
+0.00000000,
+0.430359095,
+0.735502720
54+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.00000000,
+0.516122639
55+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.00000000
66+1.06089199,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
67+0.764947057,
+1.04016650,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
68+0.946914136,
+0.749546349,
+0.799822092,
+0.799822092,
+0.378419876,
+0.541945457
69+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.430359095,
+0.735502720
70+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.516122639
73+0.678302169,
+0.565314949,
+0.378419876,
+0.430359095,
+0.378419876,
+0.516122639
74+0.764947057,
+0.749546349,
+0.541945457,
+0.735502720,
+0.430359095,
+0.541945457
75+0.812871635,
+1.04016650,
+0.764947057,
+0.749546349,
+0.516122639,
+0.565314949
76+0.946914136,
+0.825772583,
+1.04016650,
+0.799822092,
+0.825772583,
+0.735502720
77+1.06089199,
+1.06089199,
+0.799822092,
+0.946914136,
+0.812871635,
+0.678302169
80+1.06089199,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
81+0.764947057,
+1.04016650,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
82+0.946914136,
+0.749546349,
+0.799822092,
+0.799822092,
+0.378419876,
+0.541945457
83+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.430359095,
+0.735502720
84+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.516122639
88+1.06089199,
+1.06089199,
+0.764947057,
+0.946914136,
+0.812871635,
+0.678302169
89+0.764947057,
+1.04016650,
+1.04016650,
+0.749546349,
+0.825772583,
+0.565314949
90+0.946914136,
+0.749546349,
+0.799822092,
+0.799822092,
+0.378419876,
+0.541945457
91+0.812871635,
+0.825772583,
+0.378419876,
+0.430359095,
+0.430359095,
+0.735502720
92+0.678302169,
+0.565314949,
+0.541945457,
+0.735502720,
+0.516122639,
+0.516122639
106+1.94748020,
+1.28070569,
+1.59922433,
+1.00571728,
+1.19214106
107+1.22956884,
+1.87739241,
+1.79334354,
+1.57461894,
+1.93789816
108+1.20720792,
+1.97074890,
+1.15514755,
+1.94769239,
+1.41840398
111+0.00000000,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
112+1.20302057,
+0.00000000,
+0.879615784,
+0.409660816,
+0.562662899
113+0.664706230,
+0.879615784,
+0.00000000,
+1.01401091,
+0.505882204
114+1.24671340,
+0.409660816,
+1.01401091,
+0.00000000,
+0.668484688
115+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.00000000
118+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
119+0.664706230,
+0.409660816,
+0.505882204,
+0.409660816,
+0.505882204
120+1.20302057,
+0.562662899,
+0.879615784,
+0.668484688,
+0.562662899
121+1.24671340,
+0.879615784,
+1.01401091,
+1.01401091,
+0.668484688
122+1.05682135,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
125+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
126+0.664706230,
+0.409660816,
+0.505882204,
+0.409660816,
+0.505882204
127+1.05682135,
+0.562662899,
+0.664706230,
+0.668484688,
+0.562662899
128+1.24671340,
+0.879615784,
+1.01401091,
+1.01401091,
+0.668484688
129+1.20302057,
+1.20302057,
+0.879615784,
+1.24671340,
+1.05682135
132+0.00000000,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
133+1.20302057,
+0.00000000,
+0.879615784,
+0.409660816,
+0.562662899
134+0.664706230,
+0.879615784,
+0.00000000,
+1.01401091,
+0.505882204
135+1.24671340,
+0.409660816,
+1.01401091,
+0.00000000,
+0.668484688
136+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.00000000
140+0.00000000,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
141+1.20302057,
+0.00000000,
+0.879615784,
+0.409660816,
+0.562662899
142+0.664706230,
+0.879615784,
+0.00000000,
+1.01401091,
+0.505882204
143+1.24671340,
+0.409660816,
+1.01401091,
+0.00000000,
+0.668484688
144+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.00000000
154+1.20302057,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
155+0.664706230,
+0.879615784,
+0.879615784,
+0.409660816,
+0.562662899
156+1.24671340,
+0.409660816,
+1.01401091,
+1.01401091,
+0.505882204
157+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.668484688
160+0.664706230,
+0.409660816,
+0.505882204,
+0.409660816,
+0.505882204
161+1.05682135,
+0.562662899,
+0.664706230,
+0.668484688,
+0.562662899
162+1.24671340,
+0.879615784,
+1.01401091,
+1.01401091,
+0.668484688
163+1.20302057,
+1.20302057,
+0.879615784,
+1.24671340,
+1.05682135
166+1.20302057,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
167+0.664706230,
+0.879615784,
+0.879615784,
+0.409660816,
+0.562662899
168+1.24671340,
+0.409660816,
+1.01401091,
+1.01401091,
+0.505882204
169+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.668484688
173+1.20302057,
+1.20302057,
+0.664706230,
+1.24671340,
+1.05682135
174+0.664706230,
+0.879615784,
+0.879615784,
+0.409660816,
+0.562662899
175+1.24671340,
+0.409660816,
+1.01401091,
+1.01401091,
+0.505882204
176+1.05682135,
+0.562662899,
+0.505882204,
+0.668484688,
+0.668484688
189+1.66497350,
+1.20799267,
+1.84089470,
+1.30011511,
+1.79450452,
+1.07639575,
+1.72083569
192+0.00000000,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
193+0.456980824,
+0.00000000,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
194+0.175921202,
+0.632902026,
+0.00000000,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
195+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.00000000,
+0.494389415,
+0.223719358,
+0.420720577
196+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.00000000,
+0.718108714,
+0.736688375E-1
197+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.00000000,
+0.644439936
198+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.00000000
201+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
202+0.558621846E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.131596923,
+0.558621846E-1
203+0.175921202,
+0.131596923,
+0.120059013,
+0.223719358,
+0.736688375E-1,
+0.223719358,
+0.120059013
204+0.456980824,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.512843013
205+0.129531026,
+0.586511850,
+0.632902026,
+0.494389415,
+0.586511850,
+0.718108714,
+0.736688375E-1
206+0.588577747,
+0.632902026,
+0.764498889,
+0.540779591,
+0.718108714,
+0.764498889,
+0.644439936
207+0.364858389,
+0.512843013,
+0.540779591,
+0.420720577,
+0.494389415,
+0.644439936,
+0.420720577
210+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
211+0.558621846E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.131596923,
+0.558621846E-1
212+0.175921202,
+0.131596923,
+0.120059013,
+0.223719358,
+0.736688375E-1,
+0.223719358,
+0.120059013
213+0.129531026,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.736688375E-1
214+0.364858389,
+0.586511850,
+0.632902026,
+0.494389415,
+0.586511850,
+0.718108714,
+0.420720577
215+0.588577747,
+0.632902026,
+0.764498889,
+0.540779591,
+0.718108714,
+0.764498889,
+0.644439936
216+0.456980824,
+0.512843013,
+0.540779591,
+0.420720577,
+0.494389415,
+0.644439936,
+0.512843013
219+0.00000000,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
220+0.456980824,
+0.00000000,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
221+0.175921202,
+0.632902026,
+0.00000000,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
222+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.00000000,
+0.494389415,
+0.223719358,
+0.420720577
223+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.00000000,
+0.718108714,
+0.736688375E-1
224+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.00000000,
+0.644439936
225+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.00000000
229+0.00000000,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
230+0.456980824,
+0.00000000,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
231+0.175921202,
+0.632902026,
+0.00000000,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
232+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.00000000,
+0.494389415,
+0.223719358,
+0.420720577
233+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.00000000,
+0.718108714,
+0.736688375E-1
234+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.00000000,
+0.644439936
235+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.00000000
237+1,
+2,
+3,
+4,
+5,
+6,
+7
238+7,
+4,
+5,
+2,
+3,
+2,
+1
239+5,
+6,
+7,
+6,
+7,
+4,
+5
240+3,
+1,
+1,
+1,
+1,
+1,
+3
241+4,
+7,
+4,
+7,
+4,
+7,
+4
242+2,
+5,
+2,
+5,
+2,
+5,
+2
243+6,
+3,
+6,
+3,
+6,
+3,
+6
247+0.456980824,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
248+0.175921202,
+0.632902026,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
249+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
250+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.494389415,
+0.223719358,
+0.420720577
251+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.718108714,
+0.736688375E-1
252+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.644439936
255+0.558621846E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.921224356E-1,
+0.463901758E-1,
+0.131596923,
+0.558621846E-1
256+0.129531026,
+0.131596923,
+0.120059013,
+0.223719358,
+0.736688375E-1,
+0.223719358,
+0.736688375E-1
257+0.175921202,
+0.456980824,
+0.175921202,
+0.364858389,
+0.586511850,
+0.588577747,
+0.120059013
258+0.364858389,
+0.586511850,
+0.632902026,
+0.420720577,
+0.494389415,
+0.644439936,
+0.420720577
259+0.588577747,
+0.632902026,
+0.764498889,
+0.494389415,
+0.718108714,
+0.718108714,
+0.512843013
260+0.456980824,
+0.512843013,
+0.540779591,
+0.540779591,
+0.129531026,
+0.764498889,
+0.644439936
263+0.456980824,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
264+0.175921202,
+0.632902026,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
265+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
266+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.494389415,
+0.223719358,
+0.420720577
267+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.718108714,
+0.736688375E-1
268+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.644439936
272+0.456980824,
+0.456980824,
+0.175921202,
+0.364858389,
+0.129531026,
+0.588577747,
+0.558621846E-1
273+0.175921202,
+0.632902026,
+0.632902026,
+0.921224356E-1,
+0.586511850,
+0.131596923,
+0.512843013
274+0.364858389,
+0.921224356E-1,
+0.540779591,
+0.540779591,
+0.463901758E-1,
+0.764498889,
+0.120059013
275+0.129531026,
+0.586511850,
+0.463901758E-1,
+0.494389415,
+0.494389415,
+0.223719358,
+0.420720577
276+0.588577747,
+0.131596923,
+0.764498889,
+0.223719358,
+0.718108714,
+0.718108714,
+0.736688375E-1
277+0.558621846E-1,
+0.512843013,
+0.120059013,
+0.420720577,
+0.736688375E-1,
+0.644439936,
+0.644439936
279+6,
+3,
+4,
+2,
+3,
+2,
+1
280+4,
+5,
+6,
+5,
+6,
+4,
+5
281+2,
+1,
+1,
+1,
+1,
+1,
+3
282+3,
+6,
+3,
+6,
+4,
+6,
+4
283+1,
+4,
+2,
+4,
+2,
+5,
+2
284+5,
+2,
+5,
+3,
+5,
+3,
+6
292+1.13824761,
+1.50458205,
+1.82756448,
+1.93361890,
+1.94365978,
+1.72362685,
+1.58938193
295+0.00000000,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
296+0.366334438,
+0.00000000,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
297+0.689316869,
+0.322982430,
+0.00000000,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
298+0.795371234,
+0.429036856,
+0.106054425,
+0.00000000,
+0.100408792E-1,
+0.209992051,
+0.344236970
299+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.00000000,
+0.220032915,
+0.354277849
300+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.00000000,
+0.134244919
301+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.00000000
304+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
305+0.366334438,
+0.847998857E-1,
+0.103937626,
+0.100408792E-1,
+0.100408792E-1,
+0.103937626,
+0.847998857E-1
306+0.451134324,
+0.322982430,
+0.106054425,
+0.106054425,
+0.116095304,
+0.134244919,
+0.238182545
307+0.689316869,
+0.219044805,
+0.116095304,
+0.209992051,
+0.220032915,
+0.209992051,
+0.134244919
308+0.805412173,
+0.366334438,
+0.238182545,
+0.344236970,
+0.354277849,
+0.220032915,
+0.344236970
309+0.585379243,
+0.439077735,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.354277849
310+0.795371234,
+0.429036856,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
313+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
314+0.366334438,
+0.847998857E-1,
+0.103937626,
+0.100408792E-1,
+0.100408792E-1,
+0.103937626,
+0.847998857E-1
315+0.451134324,
+0.219044805,
+0.106054425,
+0.106054425,
+0.116095304,
+0.134244919,
+0.134244919
316+0.585379243,
+0.322982430,
+0.116095304,
+0.209992051,
+0.220032915,
+0.209992051,
+0.238182545
317+0.689316869,
+0.366334438,
+0.238182545,
+0.344236970,
+0.354277849,
+0.220032915,
+0.344236970
318+0.805412173,
+0.439077735,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.354277849
319+0.795371234,
+0.429036856,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
322+0.00000000,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
323+0.366334438,
+0.00000000,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
324+0.689316869,
+0.322982430,
+0.00000000,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
325+0.795371234,
+0.429036856,
+0.106054425,
+0.00000000,
+0.100408792E-1,
+0.209992051,
+0.344236970
326+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.00000000,
+0.220032915,
+0.354277849
327+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.00000000,
+0.134244919
328+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.00000000
332+0.00000000,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
333+0.366334438,
+0.00000000,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
334+0.689316869,
+0.322982430,
+0.00000000,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
335+0.795371234,
+0.429036856,
+0.106054425,
+0.00000000,
+0.100408792E-1,
+0.209992051,
+0.344236970
336+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.00000000,
+0.220032915,
+0.354277849
337+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.00000000,
+0.134244919
338+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.00000000
340+1,
+2,
+3,
+4,
+5,
+6,
+7
341+2,
+7,
+6,
+5,
+4,
+3,
+2
342+7,
+6,
+4,
+3,
+3,
+7,
+6
343+6,
+3,
+5,
+6,
+6,
+4,
+3
344+3,
+1,
+7,
+7,
+7,
+2,
+4
345+4,
+4,
+2,
+2,
+2,
+5,
+5
346+5,
+5,
+1,
+1,
+1,
+1,
+1
350+0.366334438,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
351+0.689316869,
+0.322982430,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
352+0.795371234,
+0.429036856,
+0.106054425,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
353+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.100408792E-1,
+0.209992051,
+0.344236970
354+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.220032915,
+0.354277849
355+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.134244919
358+0.366334438,
+0.847998857E-1,
+0.103937626,
+0.100408792E-1,
+0.100408792E-1,
+0.103937626,
+0.847998857E-1
359+0.451134324,
+0.219044805,
+0.106054425,
+0.106054425,
+0.116095304,
+0.134244919,
+0.134244919
360+0.689316869,
+0.322982430,
+0.116095304,
+0.209992051,
+0.220032915,
+0.219044805,
+0.238182545
361+0.805412173,
+0.366334438,
+0.238182545,
+0.344236970,
+0.354277849,
+0.209992051,
+0.344236970
362+0.585379243,
+0.439077735,
+0.322982430,
+0.429036856,
+0.439077735,
+0.220032915,
+0.354277849
363+0.795371234,
+0.429036856,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
366+0.366334438,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
367+0.689316869,
+0.322982430,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
368+0.795371234,
+0.429036856,
+0.106054425,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
369+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.100408792E-1,
+0.209992051,
+0.344236970
370+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.220032915,
+0.354277849
371+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.134244919
375+0.366334438,
+0.366334438,
+0.689316869,
+0.795371234,
+0.805412173,
+0.585379243,
+0.451134324
376+0.689316869,
+0.322982430,
+0.322982430,
+0.429036856,
+0.439077735,
+0.219044805,
+0.847998857E-1
377+0.795371234,
+0.429036856,
+0.106054425,
+0.106054425,
+0.116095304,
+0.103937626,
+0.238182545
378+0.805412173,
+0.439077735,
+0.116095304,
+0.100408792E-1,
+0.100408792E-1,
+0.209992051,
+0.344236970
379+0.585379243,
+0.219044805,
+0.103937626,
+0.209992051,
+0.220032915,
+0.220032915,
+0.354277849
380+0.451134324,
+0.847998857E-1,
+0.238182545,
+0.344236970,
+0.354277849,
+0.134244919,
+0.134244919
382+1,
+6,
+5,
+4,
+4,
+3,
+2
383+6,
+5,
+3,
+3,
+3,
+6,
+6
384+5,
+2,
+4,
+5,
+5,
+4,
+3
385+2,
+1,
+6,
+6,
+6,
+2,
+4
386+3,
+3,
+2,
+2,
+2,
+5,
+5
387+4,
+4,
+1,
+1,
+1,
+1,
+1
395+1.83875871,
+1.04778540,
+1.67640662,
+1.75058246,
+1.10400963,
+1.96462631
398+0.00000000,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
399+0.790973306,
+0.00000000,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
400+0.162352085,
+0.628621221,
+0.00000000,
+0.741758347E-1,
+0.572396994,
+0.288219690
401+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.00000000,
+0.646572828,
+0.214043856
402+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.00000000,
+0.860616684
403+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.00000000
406+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
407+0.881762505E-1,
+0.562242270E-1,
+0.741758347E-1,
+0.741758347E-1,
+0.562242270E-1,
+0.125867605
408+0.125867605,
+0.628621221,
+0.162352085,
+0.881762505E-1,
+0.572396994,
+0.916840911
409+0.790973306,
+0.702797055,
+0.628621221,
+0.702797055,
+0.646572828,
+0.214043856
410+0.734749079,
+0.790973306,
+0.572396994,
+0.646572828,
+0.734749079,
+0.860616684
411+0.162352085,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.288219690
414+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
415+0.881762505E-1,
+0.562242270E-1,
+0.741758347E-1,
+0.741758347E-1,
+0.562242270E-1,
+0.125867605
416+0.125867605,
+0.628621221,
+0.162352085,
+0.881762505E-1,
+0.572396994,
+0.214043856
417+0.790973306,
+0.702797055,
+0.628621221,
+0.702797055,
+0.646572828,
+0.288219690
418+0.734749079,
+0.790973306,
+0.572396994,
+0.646572828,
+0.734749079,
+0.860616684
419+0.162352085,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.916840911
422+0.00000000,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
423+0.790973306,
+0.00000000,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
424+0.162352085,
+0.628621221,
+0.00000000,
+0.741758347E-1,
+0.572396994,
+0.288219690
425+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.00000000,
+0.646572828,
+0.214043856
426+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.00000000,
+0.860616684
427+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.00000000
431+0.00000000,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
432+0.790973306,
+0.00000000,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
433+0.162352085,
+0.628621221,
+0.00000000,
+0.741758347E-1,
+0.572396994,
+0.288219690
434+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.00000000,
+0.646572828,
+0.214043856
435+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.00000000,
+0.860616684
436+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.00000000
438+1,
+2,
+3,
+4,
+5,
+6
439+4,
+5,
+4,
+3,
+2,
+1
440+6,
+3,
+1,
+1,
+3,
+4
441+3,
+4,
+6,
+6,
+4,
+3
442+5,
+1,
+5,
+5,
+1,
+5
443+2,
+6,
+2,
+2,
+6,
+2
447+0.790973306,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
448+0.162352085,
+0.628621221,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
449+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.741758347E-1,
+0.572396994,
+0.288219690
450+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.646572828,
+0.214043856
451+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.860616684
454+0.881762505E-1,
+0.562242270E-1,
+0.741758347E-1,
+0.741758347E-1,
+0.562242270E-1,
+0.125867605
455+0.125867605,
+0.628621221,
+0.162352085,
+0.881762505E-1,
+0.572396994,
+0.214043856
456+0.162352085,
+0.702797055,
+0.628621221,
+0.702797055,
+0.646572828,
+0.288219690
457+0.734749079,
+0.790973306,
+0.572396994,
+0.646572828,
+0.734749079,
+0.916840911
458+0.790973306,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.860616684
461+0.790973306,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
462+0.162352085,
+0.628621221,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
463+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.741758347E-1,
+0.572396994,
+0.288219690
464+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.646572828,
+0.214043856
465+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.860616684
469+0.790973306,
+0.790973306,
+0.162352085,
+0.881762505E-1,
+0.734749079,
+0.125867605
470+0.162352085,
+0.628621221,
+0.628621221,
+0.702797055,
+0.562242270E-1,
+0.916840911
471+0.881762505E-1,
+0.702797055,
+0.741758347E-1,
+0.741758347E-1,
+0.572396994,
+0.288219690
472+0.734749079,
+0.562242270E-1,
+0.572396994,
+0.646572828,
+0.646572828,
+0.214043856
473+0.125867605,
+0.916840911,
+0.288219690,
+0.214043856,
+0.860616684,
+0.860616684
475+3,
+4,
+3,
+3,
+2,
+1
476+5,
+2,
+1,
+1,
+3,
+4
477+2,
+3,
+5,
+5,
+4,
+3
478+4,
+1,
+4,
+4,
+1,
+5
479+1,
+5,
+2,
+2,
+5,
+2
- Test:
- test_pm_knn
- Todo:
- High Priority: This generic interface should be extended to support discrete distance matrices.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Fatemeh Bagheri, Thursday 8:40 PM, July 20, 2023, Dallas, TX Amir Shahmoradi, Saturday 1:00 AM, September, 1, 2018, Dallas, TX
Definition at line 181 of file pm_knn.F90.