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

Remove lonlat_2d and cartesian_2d types #662

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix haversine (and simplify static_asserts)
harrism committed Aug 24, 2022
commit 9fe19377570a1ca80844bf2335bafe56e3dd4d2d
13 changes: 6 additions & 7 deletions cpp/include/cuspatial/experimental/detail/haversine.cuh
Original file line number Diff line number Diff line change
@@ -58,23 +58,22 @@ struct haversine_distance_functor {

} // namespace detail

template <class LonLatItA, class LonLatItB, class OutputIt, class Location, class T>
template <class LonLatItA, class LonLatItB, class OutputIt, class T>
OutputIt haversine_distance(LonLatItA a_lonlat_first,
LonLatItA a_lonlat_last,
LonLatItB b_lonlat_first,
OutputIt distance_first,
T const radius,
rmm::cuda_stream_view stream)
{
using LocationA = detail::iterator_value_type<LonLatItA>;
using LocationB = detail::iterator_value_type<LonLatItB>;
static_assert(detail::is_same<vec_2d<T>, LocationA, LocationB>(),
static_assert(detail::is_same<vec_2d<T>,
detail::iterator_value_type<LonLatItA>,
detail::iterator_value_type<LonLatItB>>(),
"Inputs must be cuspatial::vec_2d");
static_assert(
detail::is_same_floating_point<T,
typename LocationA::value_type,
typename LocationB::value_type,
typename std::iterator_traits<OutputIt>::value_type>(),
typename detail::iterator_vec_base_type<LonLatItA>,
typename detail::iterator_value_type<OutputIt>>(),
"All iterator types and radius must have the same floating-point coordinate value type.");

CUSPATIAL_EXPECTS(radius > 0, "radius must be positive.");