FORTRAN SOFTWARE CATALOG

Repository owner: Jeff Hodges (jmhodges)

kdtree2

Nearest-neighbor and radius searches using k-dimensional trees.

Repository · Pinned source (dc757acec316) · Try in playground · Checked package example

GAMS classifications

About this package

Category
Computational geometry
License
AFL-1.1

Topics: computational-geometry, kd-tree, nearest-neighbor, spatial-search

Classification scope and review notes

Nearest-neighbor and radius searches. An FPM wrapper selects unchanged src-f90/kdtree2.f90; the archived upstream single-precision setting is retained. The checked main builds a tree for 30 deterministic 2D points, compares four nearest indices and squared distances against an independent direct search, and checks radius-search count, membership, distances and uniqueness. The original Academic Free License 1.1 is retained. No source edits. The implementation has global search state and is not offered as thread-safe; the old interface, C++ code, every dimension and large-scale performance are not validated.

Package dependencies

Resolved GitHub repositories used by the verified playground build, combining direct and indirect dependencies. This list does not describe internal module dependencies or native system libraries.

Required by this build

No additional GitHub package dependencies were recorded for this verified build.

Build record verified 2026-10-29.

Used by (0 selected packages)

No other selected build records this repository as a dependency. This is not a measure of usage outside the catalog.

Reviewed procedures

These mappings have pinned source evidence. A checked package example may exercise only some of them; source review is not a numerical benchmark.

kdtree2_create / kdtree2_n_nearest / kdtree2_r_nearest

Module: kdtree2_module

P N5

P: source-supported; N5: verified

Derivatives / callbacks: not applicable

Nearest-neighbor and radius searches. An FPM wrapper selects unchanged src-f90/kdtree2.f90; the archived upstream single-precision setting is retained. The checked main builds a tree for 30 deterministic 2D points, compares four nearest indices and squared distances against an independent direct search, and checks radius-search count, membership, distances and uniqueness. The original Academic Free License 1.1 is retained. No source edits. The implementation has global search state and is not offered as thread-safe; the old interface, C++ code, every dimension and large-scale performance are not validated. The class-specific N5 driver additionally verifies 36 3D searches over 48 points against exhaustive real64 distances: k=1,5,48, radii squared 0/0.125/4 and both storage rearrangement modes. Tie ordering is not prescribed; complete radius sets and uniqueness are checked. This driver does not separately verify the broad P mapping.

Pinned source: src-f90/kdtree2.f90

Author examples/tests: src-f90/kdtree2_test.f90

Load checked GAMS driver: gams-kdtree-neighbor-reference