{"id":17360761,"url":"https://github.com/ivan-pi/fortran-flann","last_synced_at":"2026-01-07T13:02:59.220Z","repository":{"id":54465943,"uuid":"323594398","full_name":"ivan-pi/fortran-flann","owner":"ivan-pi","description":"Fortran bindings to the FLANN library for performing fast approximate nearest neighbor searches in high dimensional spaces.","archived":false,"fork":false,"pushed_at":"2025-06-29T19:40:30.000Z","size":1265,"stargazers_count":15,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-20T01:56:44.886Z","etag":null,"topics":["approximate-nearest-neighbor-search","hierarchical-clustering","high-dimensional-data","kdtree","kmeans-clustering","nearest-neighbor-search","spatial-search"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivan-pi.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":"2020-12-22T10:31:20.000Z","updated_at":"2025-07-24T20:28:44.000Z","dependencies_parsed_at":"2022-08-13T16:31:03.173Z","dependency_job_id":null,"html_url":"https://github.com/ivan-pi/fortran-flann","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ivan-pi/fortran-flann","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-pi%2Ffortran-flann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-pi%2Ffortran-flann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-pi%2Ffortran-flann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-pi%2Ffortran-flann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivan-pi","download_url":"https://codeload.github.com/ivan-pi/fortran-flann/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-pi%2Ffortran-flann/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28235502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["approximate-nearest-neighbor-search","hierarchical-clustering","high-dimensional-data","kdtree","kmeans-clustering","nearest-neighbor-search","spatial-search"],"created_at":"2024-10-15T19:27:58.555Z","updated_at":"2026-01-07T13:02:59.200Z","avatar_url":"https://github.com/ivan-pi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e :warning:\n\u003e WARNING: Development of the Fortran FLANN binding is ongoing. This means the API is not yet stable and might be subject to changes. Several functions remain untested. The instructions given below might not be complete.\n\u003e :warning:\n\n# Fortran FLANN binding\n\n[![GitHub license](https://img.shields.io/badge/License-BSD--3-blue)](https://github.com/ivan-pi/fortran-flann/blob/master/LICENSE)\n[![fpm test](https://github.com/ivan-pi/fortran-flann/workflows/fpm%20test/badge.svg?branch=master\u0026event=push)](https://github.com/ivan-pi/fortran-flann/actions)\n\nFortran bindings to the [FLANN](https://github.com/mariusmuja/flann\n) library for performing fast approximate nearest neighbor searches in high dimensional spaces. \n\n* [Minimal usage example](#minimal-usage-example)\n* [Installing FLANN](#installing-flann)\n* [Using FLANN with fpm](#using-flann-with-fpm)\n* [Learn more](#learn-more)\n* [Contributing](#contributing)\n\n## Minimal usage example\n\nThe example below shows how to use a `flann_index` instance to find the 5 nearest neighbors for 1000 random test points from a 128-dimensional data set containing 10000 points:\n\n```fortran\nuse flann\nimplicit none\n\ninteger, parameter :: nn = 5, d = 128, ndata = 10000, ntest = 1000\n\nreal, allocatable, dimension(:,:) :: dataset, testset, dists\ninteger, allocatable :: indexes(:,:)\ntype(flann_index) :: idx\n\n! Allocate data and result arrays\nallocate(dataset(d,n),testset(d,ntest))\nallocate(indexes(nn,ntest),dists(nn,ntest))\n\n! Insert some random values\ncall random_number(dataset)\ncall random_number(testset)\n\n! Create a FLANN index instance\nidx = flann_index(dataset,kdtree_index_params(trees=8),'Euclidean')\ncall idx%build_index()\n\n! Perform K-nearest neighbor search\ncall idx%knn_search(testset,indexes,dists,nn,search_params(checks=128))\n\nend\n```\n\n## Installing FLANN\n\nOn Linux you can install FLANN using the command\n\n```\nsudo apt install libflann-doc libflann-dev libflann1.9\n```\n\nWindows users can follow the instructions provided in documentation of the [original FLANN project](https://github.com/mariusmuja/flann).\n\n## Using FLANN with `fpm`\n\nTo use FLANN in your project we recommed trying the new Fortran package manager - [`fpm`](https://github.com/fortran-lang/fpm). To integrate FLANN in your project add the following lines to the `[dependencies]` section of your TOML manifest file:\n\n```toml\nfortran-flann = { git = \"https://github.com/ivan-pi/fortran-flann.git\" }\n```\n\n## Learn more\n\nOn Linux systems, assuming you installed the target `libflann-doc` under default path settings, you can view the original project documentation with the command:\n```\n\u003cPDF Viewer\u003e /usr/share/doc/flann/manual.pdf\n```\nwhere the `\u003cPDF Viewer\u003e` is a program like Atril, Okular, Evince, or others. Since this package only contains Fortran bindings, for the most part the API follows the original project in C++, with the important difference we decided to use \"snake case\" across all methods.\n\nA more complete explanation of the algorithms available in FLANN can be found in the paper: \n\n\u003e Muja, M., \u0026 Lowe, D. G. (2009). Fast approximate nearest neighbors with automatic algorithm configuration. *Proceedings of the Fourth International Conference on Computer Vision Theory and Applications - Volume 1: VISAPP, (VISIGRAPP 2009)*, pages 331-340. DOI:[10.5220/0001787803310340](https://doi.org/10.5220/0001787803310340)\n\nPDF versions can be found easily with your favorite search engine. Some working links at the time of writing (2020/12/22) include: [(link 1)](https://lear.inrialpes.fr/~douze/enseignement/2014-2015/presentation_papers/muja_flann.pdf), [(link 2)](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.160.1721\u0026rep=rep1\u0026type=pdf), [(link 3)](http://image.ntua.gr/iva/files/MujaLowe_ICCVTA2009%20-%20Fast%20Approximate%20Nearest%20Neighbors%20with%20Automatic%20Algorithm%20Configuration.pdf)\n\n## Contributing\n\nFeel welcome to submit bug reports or suggest changes to the Fortran bindings by opening a new [issue](https://github.com/ivan-pi/fortran-flann/issues).\n\nIf you think you are facing an issue with the underlying FLANN library, you might be able to find an answer in the [list of open/closed issues](https://github.com/mariusmuja/flann/issues) of the original FLANN project. Unfortunately, the original project has gone stale and doesn't seem to be supported anymore.\n\nSince the Fortran bindings provided here are only a wrapper of the C interface exported in the original FLANN project, we are limited to a subset of the original FLANN functionality.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-pi%2Ffortran-flann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivan-pi%2Ffortran-flann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-pi%2Ffortran-flann/lists"}