Skip to content
ForCADDocumentation

nearest_sample_index Function

public pure function nearest_sample_index(points, query) result(index)

Stream finite metric rows and compare distances as fractionradix*power. Each coordinate pair is scaled before subtraction, so a huge common coordinate cannot erase a tiny residual in another coordinate. Only the shared query/point prefix participates; exact ties retain the first row.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: points(:,:)
real(kind=rk), intent(in) :: query(:)

Return Value integer