Skip to main content

(unofficial) `nanoflann` bindings for python and fortran.

Project description

napf

nanoflann wrappers for python and maybe fortran.

python

As nanoflann offers template classes, separate classes are implemented in napf for each {datatype, data dimension, distance metric}. All the search functions are equipped with multi-thread execution. Uses numpy.ndarray for data input and output.
Currently, the combinations of following options are supported:

  • data type: {double, float, int, long} (corresponds to {np.float64, np.float32, np.int32, np.int64})
  • data dimension: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
  • distance metric: {L1, L2}

quick start

import napf
import numpy as np

data = <data in 2D array>
queries = <query points in 2D array>

kdt = napf.KDT(tree_data=data, metric=1)

indices, distances = kdt.knn_search(
    queries=queries,
    kneighbors=3,
    nthread=4,
)
...

fortran

maybe...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napf-0.0.0.tar.gz (25.9 kB view hashes)

Uploaded Source

Built Distributions

napf-0.0.0-cp39-cp39-macosx_10_9_x86_64.whl (924.0 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

napf-0.0.0-cp38-cp38-macosx_10_9_x86_64.whl (923.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

napf-0.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (855.8 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

napf-0.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (855.8 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page