-
Notifications
You must be signed in to change notification settings - Fork 39
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
Get rid of hardcoded float in the geometry algorithms #948
Conversation
Also replace std::sqrt by Kokkos::sqrt to allow for half_t and bhalf_t calculations in the future.
{ | ||
constexpr int DIM = GeometryTraits::dimension_v<Point1>; | ||
float distance_squared = 0.0; | ||
using Coordinate = typename GeometryTraits::coordinate_type<Point1>::type; | ||
Coordinate distance_squared = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably if you want to use that coordinate type for the calculation you should cast b[d] and a[d] below.
We don't seem to enforce that the two points types are the same. Just using the coordinate type of the first point does not feel right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess we can use the type of a[d] - b[d]
to allow implicit conversions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you squash merge
|
Also replace std::sqrt by Kokkos::sqrt to allow for half_t and bhalf_t calculations in the future.