Nanoflann KD-tree spatial indexing for SVA/SRA#18
Open
adthoms wants to merge 1 commit into
Open
Conversation
…ruction Replace O(N^2) brute-force pairwise compatibility checks in MakeVecAvgInvGraph and MakeRotAvgInvGraph with nanoflann KD-tree radius searches, reducing complexity to O(N log N) build + O(N * k * log N) queries. For SVA: direct radius search in measurement space. For SRA: embed rotations as 9D vectors (flattened 3x3 matrices), use chordal distance as KD-tree metric. For geodesic mode, use chordal upper bound as pre-filter then refine with exact geodesic check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MakeVecAvgInvGraph(SVA) andMakeRotAvgInvGraph(SRA) with nanoflann KD-tree radius searches, reducing complexity to O(N log N) build + O(N * k * log N) queriesSo3GeodesicDistfunctorBuildGraphFromHalfEdgeshelper that converts half-edge adjacency lists to anyGraphsStorageType(ADJ_LIST, CSR, ATOMIC_CSR)download_project(same pattern as xenium)Test plan
SVA KD-tree produces correct results across graph typestest validates all three graph storage types (ADJ_LIST, CSR, ATOMIC_CSR) produce identical inlier resultsSRA KD-tree chordal equivalencetest validates chordal distance mode with and without outliersSRA KD-tree geodesic equivalencetest validates geodesic distance mode with and without outliers (using CSR storage)🤖 Generated with Claude Code