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

Get rid of hardcoded float in the geometry algorithms #948

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Sep 7, 2023

Also replace std::sqrt by Kokkos::sqrt to allow for half_t and bhalf_t calculations in the future.

Also replace std::sqrt by Kokkos::sqrt to allow for half_t and bhalf_t
calculations in the future.
@aprokop aprokop added the enhancement New feature or request label Sep 7, 2023
{
constexpr int DIM = GeometryTraits::dimension_v<Point1>;
float distance_squared = 0.0;
using Coordinate = typename GeometryTraits::coordinate_type<Point1>::type;
Coordinate distance_squared = 0;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

@masterleinad masterleinad left a 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.

Copy link
Contributor

@dalg24 dalg24 left a 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

@aprokop
Copy link
Contributor Author

aprokop commented Sep 11, 2023

Clang build did not start. All others pass.

@aprokop aprokop merged commit 19696cb into arborx:master Sep 11, 2023
1 check passed
@aprokop aprokop deleted the auto_algorithms branch September 11, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants