{"id":17495620,"url":"https://github.com/iraikov/kdtree","last_synced_at":"2026-02-08T00:03:18.083Z","repository":{"id":8722867,"uuid":"10394414","full_name":"iraikov/kdtree","owner":"iraikov","description":"KD tree implementation in Standard ML / MLton","archived":false,"fork":false,"pushed_at":"2016-11-07T21:57:03.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T14:58:20.329Z","etag":null,"topics":["kd-tree","kdtree","mlton","spatial-index","standard-ml"],"latest_commit_sha":null,"homepage":null,"language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iraikov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-30T23:46:41.000Z","updated_at":"2020-05-28T23:25:14.000Z","dependencies_parsed_at":"2022-09-05T00:50:37.575Z","dependency_job_id":null,"html_url":"https://github.com/iraikov/kdtree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iraikov/kdtree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fkdtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fkdtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fkdtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fkdtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iraikov","download_url":"https://codeload.github.com/iraikov/kdtree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fkdtree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29213487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T23:58:20.073Z","status":"ssl_error","status_checked_at":"2026-02-07T23:58:07.729Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kd-tree","kdtree","mlton","spatial-index","standard-ml"],"created_at":"2024-10-19T14:15:18.620Z","updated_at":"2026-02-08T00:03:18.061Z","avatar_url":"https://github.com/iraikov.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"kdtree\n======\n\nStandard ML implementation of the K-d tree spatial indexing data structure.\n \n http://en.wikipedia.org/wiki/K-d_tree\n\nThe k-d tree is a binary search tree in which every branching node\ncontains a k-dimensional point, and every leaf node contains a set of\npoints. Every branching node represents a splitting hyperplane that\ndivides the space into two parts, known as half-spaces.\n\nPoints to the left of the splitting hyperplane are contained in the\nleft subtree of the node and points right of the hyperplane are\ncontained in the right subtree. The splitting hyperplane is chosen so\nas to be perpendicular to one of the axes in the k-dimensional\nspace. The axis at each branching level is chosen in a round-robin\nfashion. For instance, in 3-D space, at level 0, the chosen axis is X,\nso points are divided according to their X-coordinates; at level 1,\nthe chosen axis is Y, so the points are divided according to their\nY-coordinates; at the next branch level the chosen axis is Z, and so\non.\n\n\nKDTREE         -Signature-\n\n\n type point\n type kdtree\n\n val empty: kdtree -\u003e bool\n\nReturns true if the given tree is empty, false otherwise.\n\n val app: (point -\u003e unit) -\u003e kdtree -\u003e unit\n\nApplies the given procedure to every point in the tree.\n\n val appi: (int * point -\u003e unit)  -\u003e kdtree -\u003e unit\n\nApplies the given procedure to every point in the tree and its index.\n\n val foldl: ((point * 'a) -\u003e 'a) -\u003e 'a -\u003e kdtree -\u003e 'a\n val foldli: ((int * point * 'a) -\u003e 'a) -\u003e 'a -\u003e kdtree -\u003e 'a\n val foldr: ((point * 'a) -\u003e 'a) -\u003e 'a -\u003e kdtree -\u003e 'a\n val foldri: ((int * point * 'a) -\u003e 'a) -\u003e 'a -\u003e kdtree -\u003e 'a\n\nFolds over the tree.\n\n val ifoldr: ((int * 'a) -\u003e 'a) -\u003e 'a -\u003e kdtree -\u003e 'a\n\nFolds over the tree using only point indices.\n\n val size: kdtree -\u003e int\n\nReturns the size of the tree.\n\n val toList: kdtree -\u003e point list\n\nReturns the list of points contained in the tree.\n\n val toIndexList: kdtree -\u003e int list\n\nReturns the list of points indices contained in the tree.\n\n val fromTensor: RTensor.tensor -\u003e kdtree\n\nGiven a tensor of dimensionality [N,K], constructs a KD-tree.\n\n val nearestNeighbor: kdtree -\u003e real list -\u003e int option\n\n val nearNeighbors: kdtree -\u003e real -\u003e real list -\u003e int list\n\n val remove: kdtree -\u003e real -\u003e real list -\u003e kdtree\n\n val kNearestNeighbors: kdtree -\u003e int -\u003e real list -\u003e int list\n\n\nKDtreeFn         -Functor-\n\n\nfunctor KDTreeFn (val K : int\n                  val distanceSquared : (real list) * (real list) -\u003e real): KDTREE \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fkdtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firaikov%2Fkdtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fkdtree/lists"}