GithubHelp home page GithubHelp logo

alexeybelkov / parinterp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 34.62 MB

Python binding of 2D delaunay triangulation and parallel linear interpolation

CMake 1.16% Python 7.60% C++ 90.71% Shell 0.53%

parinterp's Introduction

parinterp

Python library for parallel linear 2D interpolation, it consists of two main parts:

Being almost fully written in C++ and binded via pybind11, library achieved very high perfomance

Installation

git clone https://github.com/alexeybelkov/parinterp
cd parinterp
pip install -r requirements.txt
./install.sh

Usage

import numpy as np
from parinterp import Linear2DInterpolator
n, m = 1024, 2
points = np.random.randint(low=0, high=1024, size=(n, m))
points = np.unique(points, axis=0)
x_points = points[: n // 2]
values = np.random.uniform(low=0.0, high=1.0, size=(len(x_points),))
interp_points = points[n // 2:]
n_jobs = -1 # will be equal to num of CPU cores
interpolator = Linear2DInterpolator(x_points, values, n_jobs)
# Also you can pass values to __call__ and rewrite the ones that were passed to __init__
interp_values = interpolator(interp_points, values + 1.0, fill_value=0.0)

TODO

  • Currently, there are a lot of presumably unnecessary reallocations, try to find a way to remove them
  • Using Python's scipy KDTree is more like a crutch, find fast C++ one-nearest-neighbour algorithm implementation
  • Find a way to build a fast bijection $f : S \rightarrow {0, 1, ..., n}$, where $S \subset \mathbf{N}$
  • Maybe consider this Parallel Nearest Neighbors in Low Dimensions with Batch Updates
  • Compare perfomance with and without safety

Usefull links

Point location algorithm was highly inspired by paper Fast randomized point location without preprocessing in two- and three-dimensional Delaunay triangulations

parinterp's People

Contributors

alexeybelkov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.