[Fix] compute distance to origin after sort (#1500)

pull/1605/head
Jiazhen Wang 2021-12-22 10:13:22 +08:00 committed by GitHub
parent e4b5348ebf
commit a0b87245f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -220,6 +220,10 @@ HOST_DEVICE_INLINE int convex_hull_graham(const Point<T> (&p)[24],
return temp > 0;
}
});
// compute distance to origin after sort, since the points are now different.
for (int i = 0; i < num_in; i++) {
dist[i] = dot_2d<T>(q[i], q[i]);
}
#endif
// Step 4: