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.46963179,
+1.88858938,
+1.88620615,
+1.76696968,
+1.51134932,
+1.65217352
15+0.00000000,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
16+0.418957561,
+0.00000000,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
17+0.416574359,
+0.238323212E-2,
+0.00000000,
+0.119236469,
+0.374856830,
+0.234032616
18+0.297337860,
+0.121619701,
+0.119236469,
+0.00000000,
+0.255620360,
+0.114796162
19+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.00000000,
+0.140824199
20+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.00000000
23+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
24+0.417175293E-1,
+0.238323212E-2,
+0.238323212E-2,
+0.114796162,
+0.417175293E-1,
+0.114796162
25+0.182541728,
+0.121619701,
+0.119236469,
+0.119236469,
+0.140824199,
+0.140824199
26+0.297337860,
+0.236415863,
+0.234032616,
+0.121619701,
+0.255620360,
+0.182541728
27+0.418957561,
+0.377240062,
+0.374856830,
+0.255620360,
+0.377240062,
+0.236415863
28+0.416574359,
+0.418957561,
+0.416574359,
+0.297337860,
+0.374856830,
+0.234032616
31+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
32+0.417175293E-1,
+0.238323212E-2,
+0.238323212E-2,
+0.114796162,
+0.417175293E-1,
+0.114796162
33+0.182541728,
+0.121619701,
+0.119236469,
+0.119236469,
+0.140824199,
+0.140824199
34+0.297337860,
+0.236415863,
+0.234032616,
+0.121619701,
+0.255620360,
+0.182541728
35+0.418957561,
+0.377240062,
+0.374856830,
+0.255620360,
+0.377240062,
+0.236415863
36+0.416574359,
+0.418957561,
+0.416574359,
+0.297337860,
+0.374856830,
+0.234032616
39+0.00000000,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
40+0.418957561,
+0.00000000,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
41+0.416574359,
+0.238323212E-2,
+0.00000000,
+0.119236469,
+0.374856830,
+0.234032616
42+0.297337860,
+0.121619701,
+0.119236469,
+0.00000000,
+0.255620360,
+0.114796162
43+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.00000000,
+0.140824199
44+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.00000000
48+0.00000000,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
49+0.418957561,
+0.00000000,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
50+0.416574359,
+0.238323212E-2,
+0.00000000,
+0.119236469,
+0.374856830,
+0.234032616
51+0.297337860,
+0.121619701,
+0.119236469,
+0.00000000,
+0.255620360,
+0.114796162
52+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.00000000,
+0.140824199
53+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.00000000
64+0.418957561,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
65+0.416574359,
+0.238323212E-2,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
66+0.297337860,
+0.121619701,
+0.119236469,
+0.119236469,
+0.374856830,
+0.234032616
67+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.255620360,
+0.114796162
68+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.140824199
71+0.417175293E-1,
+0.238323212E-2,
+0.238323212E-2,
+0.114796162,
+0.417175293E-1,
+0.114796162
72+0.182541728,
+0.121619701,
+0.119236469,
+0.119236469,
+0.140824199,
+0.140824199
73+0.297337860,
+0.236415863,
+0.234032616,
+0.121619701,
+0.377240062,
+0.182541728
74+0.416574359,
+0.377240062,
+0.374856830,
+0.255620360,
+0.255620360,
+0.236415863
75+0.418957561,
+0.418957561,
+0.416574359,
+0.297337860,
+0.374856830,
+0.234032616
78+0.418957561,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
79+0.416574359,
+0.238323212E-2,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
80+0.297337860,
+0.121619701,
+0.119236469,
+0.119236469,
+0.374856830,
+0.234032616
81+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.255620360,
+0.114796162
82+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.140824199
86+0.418957561,
+0.418957561,
+0.416574359,
+0.297337860,
+0.417175293E-1,
+0.182541728
87+0.416574359,
+0.238323212E-2,
+0.238323212E-2,
+0.121619701,
+0.377240062,
+0.236415863
88+0.297337860,
+0.121619701,
+0.119236469,
+0.119236469,
+0.374856830,
+0.234032616
89+0.417175293E-1,
+0.377240062,
+0.374856830,
+0.255620360,
+0.255620360,
+0.114796162
90+0.182541728,
+0.236415863,
+0.234032616,
+0.114796162,
+0.140824199,
+0.140824199
104+1.19873738,
+1.22387457,
+1.53244543,
+1.92931390,
+1.97872508,
+1.54305005,
+1.72983634
107+0.00000000,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
108+0.251371861E-1,
+0.00000000,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
109+0.333708048,
+0.308570862,
+0.00000000,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
110+0.730576515,
+0.705439329,
+0.396868467,
+0.00000000,
+0.494111776E-1,
+0.386263847,
+0.199477553
111+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.00000000,
+0.435675025,
+0.248888716
112+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.00000000,
+0.186786294
113+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.00000000
116+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
117+0.251371861E-1,
+0.251371861E-1,
+0.106046200E-1,
+0.494111776E-1,
+0.494111776E-1,
+0.106046200E-1,
+0.186786294
118+0.333708048,
+0.308570862,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.197390899
119+0.344312668,
+0.319175482,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.199477553
120+0.531098962,
+0.505961776,
+0.333708048,
+0.396868467,
+0.446279645,
+0.344312668,
+0.248888716
121+0.779987633,
+0.754850447,
+0.446279645,
+0.386263847,
+0.435675025,
+0.435675025,
+0.505961776
122+0.730576515,
+0.705439329,
+0.396868467,
+0.730576515,
+0.779987633,
+0.386263847,
+0.531098962
125+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
126+0.251371861E-1,
+0.251371861E-1,
+0.106046200E-1,
+0.494111776E-1,
+0.494111776E-1,
+0.106046200E-1,
+0.186786294
127+0.333708048,
+0.308570862,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.197390899
128+0.344312668,
+0.319175482,
+0.308570862,
+0.386263847,
+0.435675025,
+0.319175482,
+0.199477553
129+0.531098962,
+0.505961776,
+0.333708048,
+0.396868467,
+0.446279645,
+0.344312668,
+0.248888716
130+0.779987633,
+0.754850447,
+0.446279645,
+0.705439329,
+0.754850447,
+0.435675025,
+0.505961776
131+0.730576515,
+0.705439329,
+0.396868467,
+0.730576515,
+0.779987633,
+0.386263847,
+0.531098962
134+0.00000000,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
135+0.251371861E-1,
+0.00000000,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
136+0.333708048,
+0.308570862,
+0.00000000,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
137+0.730576515,
+0.705439329,
+0.396868467,
+0.00000000,
+0.494111776E-1,
+0.386263847,
+0.199477553
138+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.00000000,
+0.435675025,
+0.248888716
139+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.00000000,
+0.186786294
140+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.00000000
144+0.00000000,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
145+0.251371861E-1,
+0.00000000,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
146+0.333708048,
+0.308570862,
+0.00000000,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
147+0.730576515,
+0.705439329,
+0.396868467,
+0.00000000,
+0.494111776E-1,
+0.386263847,
+0.199477553
148+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.00000000,
+0.435675025,
+0.248888716
149+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.00000000,
+0.186786294
150+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.00000000
152+1,
+2,
+3,
+4,
+5,
+6,
+7
153+2,
+1,
+6,
+5,
+4,
+3,
+6
154+3,
+3,
+7,
+7,
+7,
+7,
+3
155+6,
+6,
+2,
+6,
+6,
+2,
+4
156+7,
+7,
+1,
+3,
+3,
+1,
+5
157+4,
+4,
+4,
+2,
+2,
+4,
+2
158+5,
+5,
+5,
+1,
+1,
+5,
+1
162+0.251371861E-1,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
163+0.333708048,
+0.308570862,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
164+0.730576515,
+0.705439329,
+0.396868467,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
165+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.494111776E-1,
+0.386263847,
+0.199477553
166+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.435675025,
+0.248888716
167+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.186786294
170+0.251371861E-1,
+0.251371861E-1,
+0.106046200E-1,
+0.494111776E-1,
+0.494111776E-1,
+0.106046200E-1,
+0.186786294
171+0.333708048,
+0.308570862,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.197390899
172+0.344312668,
+0.319175482,
+0.308570862,
+0.386263847,
+0.435675025,
+0.319175482,
+0.505961776
173+0.531098962,
+0.505961776,
+0.333708048,
+0.396868467,
+0.446279645,
+0.386263847,
+0.199477553
174+0.779987633,
+0.754850447,
+0.446279645,
+0.705439329,
+0.754850447,
+0.435675025,
+0.248888716
175+0.730576515,
+0.705439329,
+0.396868467,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
178+0.251371861E-1,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
179+0.333708048,
+0.308570862,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
180+0.730576515,
+0.705439329,
+0.396868467,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
181+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.494111776E-1,
+0.386263847,
+0.199477553
182+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.435675025,
+0.248888716
183+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.186786294
187+0.251371861E-1,
+0.251371861E-1,
+0.333708048,
+0.730576515,
+0.779987633,
+0.344312668,
+0.531098962
188+0.333708048,
+0.308570862,
+0.308570862,
+0.705439329,
+0.754850447,
+0.319175482,
+0.505961776
189+0.730576515,
+0.705439329,
+0.396868467,
+0.396868467,
+0.446279645,
+0.106046200E-1,
+0.197390899
190+0.779987633,
+0.754850447,
+0.446279645,
+0.494111776E-1,
+0.494111776E-1,
+0.386263847,
+0.199477553
191+0.344312668,
+0.319175482,
+0.106046200E-1,
+0.386263847,
+0.435675025,
+0.435675025,
+0.248888716
192+0.531098962,
+0.505961776,
+0.197390899,
+0.199477553,
+0.248888716,
+0.186786294,
+0.186786294
194+1,
+1,
+5,
+4,
+4,
+3,
+6
195+2,
+2,
+6,
+6,
+6,
+6,
+3
196+5,
+5,
+2,
+5,
+5,
+2,
+4
197+6,
+6,
+1,
+3,
+3,
+1,
+5
198+3,
+3,
+3,
+2,
+2,
+4,
+2
199+4,
+4,
+4,
+1,
+1,
+5,
+1
207+1.32306516,
+1.19780850,
+1.34577632,
+1.53086710,
+1.07220435
208+1.99196148,
+1.89935422,
+1.27896810,
+1.46570790,
+1.56313086
211+0.00000000,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
212+0.155773342,
+0.00000000,
+0.637787938,
+0.546788096,
+0.358918607
213+0.713354945,
+0.637787938,
+0.00000000,
+0.262926519,
+0.394449085
214+0.565795481,
+0.546788096,
+0.262926519,
+0.00000000,
+0.468895257
215+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.00000000
218+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
219+0.155773342,
+0.155773342,
+0.262926519,
+0.262926519,
+0.358918607
220+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.394449085
221+0.565795481,
+0.546788096,
+0.637787938,
+0.546788096,
+0.468895257
222+0.713354945,
+0.637787938,
+0.713354945,
+0.565795481,
+0.496816725
225+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
226+0.155773342,
+0.155773342,
+0.262926519,
+0.262926519,
+0.358918607
227+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.394449085
228+0.565795481,
+0.546788096,
+0.637787938,
+0.546788096,
+0.468895257
229+0.713354945,
+0.637787938,
+0.713354945,
+0.565795481,
+0.496816725
232+0.00000000,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
233+0.155773342,
+0.00000000,
+0.637787938,
+0.546788096,
+0.358918607
234+0.713354945,
+0.637787938,
+0.00000000,
+0.262926519,
+0.394449085
235+0.565795481,
+0.546788096,
+0.262926519,
+0.00000000,
+0.468895257
236+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.00000000
240+0.00000000,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
241+0.155773342,
+0.00000000,
+0.637787938,
+0.546788096,
+0.358918607
242+0.713354945,
+0.637787938,
+0.00000000,
+0.262926519,
+0.394449085
243+0.565795481,
+0.546788096,
+0.262926519,
+0.00000000,
+0.468895257
244+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.00000000
254+0.155773342,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
255+0.713354945,
+0.637787938,
+0.637787938,
+0.546788096,
+0.358918607
256+0.565795481,
+0.546788096,
+0.262926519,
+0.262926519,
+0.394449085
257+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.468895257
260+0.155773342,
+0.155773342,
+0.262926519,
+0.262926519,
+0.358918607
261+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.394449085
262+0.565795481,
+0.546788096,
+0.637787938,
+0.546788096,
+0.468895257
263+0.713354945,
+0.637787938,
+0.713354945,
+0.565795481,
+0.496816725
266+0.155773342,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
267+0.713354945,
+0.637787938,
+0.637787938,
+0.546788096,
+0.358918607
268+0.565795481,
+0.546788096,
+0.262926519,
+0.262926519,
+0.394449085
269+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.468895257
273+0.155773342,
+0.155773342,
+0.713354945,
+0.565795481,
+0.496816725
274+0.713354945,
+0.637787938,
+0.637787938,
+0.546788096,
+0.358918607
275+0.565795481,
+0.546788096,
+0.262926519,
+0.262926519,
+0.394449085
276+0.496816725,
+0.358918607,
+0.394449085,
+0.468895257,
+0.468895257
289+1.14499581,
+1.86472082,
+1.70164847,
+1.68611348,
+1.74006128,
+1.77442622,
+1.01241195
290+1.11802006,
+1.51692080,
+1.39452314,
+1.87307048,
+1.19441605,
+1.29505479,
+1.25156760
293+0.00000000,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
294+0.822876573,
+0.00000000,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
295+0.621543348,
+0.203896493,
+0.00000000,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
296+0.928929210,
+0.398425847,
+0.478799433,
+0.00000000,
+0.680795252,
+0.584723234,
+0.916591287
297+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.00000000,
+0.106344283,
+0.729890347
298+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.00000000,
+0.763254106
299+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.00000000
302+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
303+0.188184544,
+0.203896493,
+0.123249948,
+0.398425847,
+0.106344283,
+0.106344283,
+0.188184544
304+0.621543348,
+0.239536300,
+0.203760624,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
305+0.822876573,
+0.345759064,
+0.203896493,
+0.584723234,
+0.345759064,
+0.239536300,
+0.892660439
306+0.599949360,
+0.398425847,
+0.478799433,
+0.680795252,
+0.599949360,
+0.584723234,
+0.729890347
307+0.653853118,
+0.822876573,
+0.621543348,
+0.916591287,
+0.680795252,
+0.653853118,
+0.763254106
308+0.928929210,
+0.892660439,
+0.703905702,
+0.928929210,
+0.729890347,
+0.763254106,
+0.916591287
311+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
312+0.188184544,
+0.203896493,
+0.123249948,
+0.398425847,
+0.106344283,
+0.106344283,
+0.188184544
313+0.599949360,
+0.239536300,
+0.203760624,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
314+0.653853118,
+0.345759064,
+0.203896493,
+0.584723234,
+0.345759064,
+0.239536300,
+0.763254106
315+0.621543348,
+0.398425847,
+0.478799433,
+0.680795252,
+0.599949360,
+0.584723234,
+0.729890347
316+0.822876573,
+0.822876573,
+0.621543348,
+0.916591287,
+0.680795252,
+0.653853118,
+0.892660439
317+0.928929210,
+0.892660439,
+0.703905702,
+0.928929210,
+0.729890347,
+0.763254106,
+0.916591287
320+0.00000000,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
321+0.822876573,
+0.00000000,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
322+0.621543348,
+0.203896493,
+0.00000000,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
323+0.928929210,
+0.398425847,
+0.478799433,
+0.00000000,
+0.680795252,
+0.584723234,
+0.916591287
324+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.00000000,
+0.106344283,
+0.729890347
325+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.00000000,
+0.763254106
326+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.00000000
330+0.00000000,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
331+0.822876573,
+0.00000000,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
332+0.621543348,
+0.203896493,
+0.00000000,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
333+0.928929210,
+0.398425847,
+0.478799433,
+0.00000000,
+0.680795252,
+0.584723234,
+0.916591287
334+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.00000000,
+0.106344283,
+0.729890347
335+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.00000000,
+0.763254106
336+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.00000000
338+1,
+2,
+3,
+4,
+5,
+6,
+7
339+7,
+3,
+6,
+2,
+6,
+5,
+1
340+5,
+6,
+5,
+3,
+3,
+3,
+3
341+3,
+5,
+2,
+6,
+2,
+2,
+5
342+6,
+4,
+4,
+5,
+1,
+4,
+6
343+2,
+1,
+1,
+7,
+4,
+1,
+2
344+4,
+7,
+7,
+1,
+7,
+7,
+4
348+0.822876573,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
349+0.621543348,
+0.203896493,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
350+0.928929210,
+0.398425847,
+0.478799433,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
351+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.680795252,
+0.584723234,
+0.916591287
352+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.106344283,
+0.729890347
353+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.763254106
356+0.188184544,
+0.203896493,
+0.123249948,
+0.398425847,
+0.106344283,
+0.106344283,
+0.188184544
357+0.599949360,
+0.239536300,
+0.203760624,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
358+0.621543348,
+0.345759064,
+0.203896493,
+0.584723234,
+0.345759064,
+0.239536300,
+0.892660439
359+0.653853118,
+0.398425847,
+0.478799433,
+0.680795252,
+0.599949360,
+0.584723234,
+0.916591287
360+0.822876573,
+0.822876573,
+0.621543348,
+0.916591287,
+0.680795252,
+0.653853118,
+0.729890347
361+0.928929210,
+0.892660439,
+0.703905702,
+0.928929210,
+0.729890347,
+0.763254106,
+0.763254106
364+0.822876573,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
365+0.621543348,
+0.203896493,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
366+0.928929210,
+0.398425847,
+0.478799433,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
367+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.680795252,
+0.584723234,
+0.916591287
368+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.106344283,
+0.729890347
369+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.763254106
373+0.822876573,
+0.822876573,
+0.621543348,
+0.928929210,
+0.599949360,
+0.653853118,
+0.188184544
374+0.621543348,
+0.203896493,
+0.203896493,
+0.398425847,
+0.345759064,
+0.239536300,
+0.892660439
375+0.928929210,
+0.398425847,
+0.478799433,
+0.478799433,
+0.203760624,
+0.123249948,
+0.703905702
376+0.599949360,
+0.345759064,
+0.203760624,
+0.680795252,
+0.680795252,
+0.584723234,
+0.916591287
377+0.653853118,
+0.239536300,
+0.123249948,
+0.584723234,
+0.106344283,
+0.106344283,
+0.729890347
378+0.188184544,
+0.892660439,
+0.703905702,
+0.916591287,
+0.729890347,
+0.763254106,
+0.763254106
380+6,
+2,
+5,
+2,
+5,
+5,
+1
381+4,
+5,
+4,
+3,
+3,
+3,
+3
382+2,
+4,
+2,
+5,
+2,
+2,
+5
383+5,
+3,
+3,
+4,
+1,
+4,
+6
384+1,
+1,
+1,
+6,
+4,
+1,
+2
385+3,
+6,
+6,
+1,
+6,
+6,
+4
393+1.03682196,
+1.65983784,
+1.68733382,
+1.16162062,
+1.25189781,
+1.11390209
394+1.55833006,
+1.78287172,
+1.24157822,
+1.37087226,
+1.02414238,
+1.34744239
395+1.18960762,
+1.62568247,
+1.90040207,
+1.91012716,
+1.96546972,
+1.95109773
398+0.00000000,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
399+0.792924285,
+0.00000000,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
400+1.01426136,
+0.607639313,
+0.00000000,
+0.541466415,
+0.491036296,
+0.585321426
401+0.754893005,
+0.706309259,
+0.541466415,
+0.00000000,
+0.362538785,
+0.671163499E-1
402+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.00000000,
+0.351812810
403+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.00000000
406+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
407+0.754893005,
+0.607639313,
+0.491036296,
+0.671163499E-1,
+0.351812810,
+0.671163499E-1
408+0.792924285,
+0.706309259,
+0.541466415,
+0.362538785,
+0.362538785,
+0.351812810
409+0.793903112,
+0.770415246,
+0.585321426,
+0.541466415,
+0.491036296,
+0.585321426
410+0.966217458,
+0.926034927,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
411+1.01426136,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
414+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
415+0.754893005,
+0.607639313,
+0.491036296,
+0.671163499E-1,
+0.351812810,
+0.671163499E-1
416+0.792924285,
+0.706309259,
+0.541466415,
+0.362538785,
+0.362538785,
+0.351812810
417+0.793903112,
+0.770415246,
+0.585321426,
+0.541466415,
+0.491036296,
+0.585321426
418+0.966217458,
+0.926034927,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
419+1.01426136,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
422+0.00000000,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
423+0.792924285,
+0.00000000,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
424+1.01426136,
+0.607639313,
+0.00000000,
+0.541466415,
+0.491036296,
+0.585321426
425+0.754893005,
+0.706309259,
+0.541466415,
+0.00000000,
+0.362538785,
+0.671163499E-1
426+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.00000000,
+0.351812810
427+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.00000000
431+0.00000000,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
432+0.792924285,
+0.00000000,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
433+1.01426136,
+0.607639313,
+0.00000000,
+0.541466415,
+0.491036296,
+0.585321426
434+0.754893005,
+0.706309259,
+0.541466415,
+0.00000000,
+0.362538785,
+0.671163499E-1
435+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.00000000,
+0.351812810
436+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.00000000
438+1,
+2,
+3,
+4,
+5,
+6
439+4,
+3,
+5,
+6,
+6,
+4
440+2,
+4,
+4,
+5,
+4,
+5
441+6,
+6,
+6,
+3,
+3,
+3
442+5,
+1,
+2,
+2,
+2,
+2
443+3,
+5,
+1,
+1,
+1,
+1
447+0.792924285,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
448+1.01426136,
+0.607639313,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
449+0.754893005,
+0.706309259,
+0.541466415,
+0.541466415,
+0.491036296,
+0.585321426
450+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.362538785,
+0.671163499E-1
451+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.351812810
454+0.754893005,
+0.607639313,
+0.491036296,
+0.671163499E-1,
+0.351812810,
+0.671163499E-1
455+0.792924285,
+0.706309259,
+0.541466415,
+0.362538785,
+0.362538785,
+0.351812810
456+1.01426136,
+0.770415246,
+0.585321426,
+0.541466415,
+0.491036296,
+0.585321426
457+0.966217458,
+0.926034927,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
458+0.793903112,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
461+0.792924285,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
462+1.01426136,
+0.607639313,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
463+0.754893005,
+0.706309259,
+0.541466415,
+0.541466415,
+0.491036296,
+0.585321426
464+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.362538785,
+0.671163499E-1
465+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.351812810
469+0.792924285,
+0.792924285,
+1.01426136,
+0.754893005,
+0.966217458,
+0.793903112
470+1.01426136,
+0.607639313,
+0.607639313,
+0.706309259,
+0.926034927,
+0.770415246
471+0.754893005,
+0.706309259,
+0.541466415,
+0.541466415,
+0.491036296,
+0.585321426
472+0.966217458,
+0.926034927,
+0.491036296,
+0.362538785,
+0.362538785,
+0.671163499E-1
473+0.793903112,
+0.770415246,
+0.585321426,
+0.671163499E-1,
+0.351812810,
+0.351812810
475+3,
+2,
+4,
+5,
+5,
+4
476+1,
+3,
+3,
+4,
+4,
+5
477+5,
+5,
+5,
+3,
+3,
+3
478+4,
+1,
+2,
+2,
+2,
+2
479+2,
+4,
+1,
+1,
+1,
+1
- 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.