Learn R Programming

resemble (version 2.2.3)

which_min_vector: A function to compute indices of minimum values of a distance vector

Description

For internal use only

Usage

which_min_vector(X)

Value

a vector of the indices of the nearest neighbors

Arguments

X

a vector of distances

Author

Antoine Stevens

Details

Used internally to find the nearest neighbors. It searches in lower (or upper) triangular matrix. Therefore this must be the format of the input data. The piece of code int len = (sqrt(X.size()*8+1)+1)/2 generated an error in CRAN since sqrt cannot be applied to integers.