Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added numpy vectorized version of haversine function #26

Closed
wants to merge 5 commits into from

Conversation

ccforgy
Copy link
Contributor

@ccforgy ccforgy commented Dec 31, 2019

I've created a function "haversine_vector" that is merely the original "haversine" function with math library functions replaced with numpy functions in order to rapidly calculate the distance between two arrays of points.

Some quick "timeit" benchmarks indicate that for computing the haversine distance between two points, the vectorized version takes around 1.5 times longer than the regular version, whereas for computing the distance between two sets of 100 points each it's about 24 times faster.

Added second version of haversine function that uses vectorized numpy functions (instead of scalar math library functions).
@jdeniau jdeniau self-requested a review January 1, 2020 22:09
@jdeniau
Copy link
Member

jdeniau commented Jan 6, 2020

Released in 2.2.0.

Sorry for the PR, I messed up with github, and commited on master. You appear as contributor though

@jdeniau jdeniau closed this Jan 6, 2020
@ccforgy
Copy link
Contributor Author

ccforgy commented Jan 7, 2020 via email

@jdeniau jdeniau mentioned this pull request Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants