Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ void NO_INLINE correctConvexHull(std::vector<Point> const& points, std::vector<P
std::vector<Point> lowerHull;
upperHull.push_back(pointsSorted[0]);
upperHull.push_back(pointsSorted[1]);
lowerHull.push_back(pointsSorted[pointsSorted.size() - 1]);
lowerHull.push_back(pointsSorted[pointsSorted.size() - 2]);

for (size_t i = 2; i < pointsSorted.size(); i++) {
while (upperHull.size() > 1
Expand All @@ -47,7 +49,7 @@ void NO_INLINE correctConvexHull(std::vector<Point> const& points, std::vector<P
}
lowerHull.push_back(pointsSorted[pointsSorted.size() - i - 1]);
}
upperHull.insert(upperHull.end(), lowerHull.begin(), lowerHull.end());
upperHull.insert(upperHull.end(), lowerHull.begin()+1, lowerHull.end()-1);

hull = upperHull;
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ double NO_INLINE correctConvexHullPerimeter(std::vector<Point> const& points) {
std::vector<Point> lowerHull;
upperHull.push_back(pointsSorted[0]);
upperHull.push_back(pointsSorted[1]);
lowerHull.push_back(pointsSorted[pointsSorted.size() - 1]);
lowerHull.push_back(pointsSorted[pointsSorted.size() - 2]);

for (size_t i = 2; i < pointsSorted.size(); i++) {
while (upperHull.size() > 1
Expand All @@ -52,7 +54,7 @@ double NO_INLINE correctConvexHullPerimeter(std::vector<Point> const& points) {
}
lowerHull.push_back(pointsSorted[pointsSorted.size() - i - 1]);
}
upperHull.insert(upperHull.end(), lowerHull.begin(), lowerHull.end());
upperHull.insert(upperHull.end(), lowerHull.begin()+1, lowerHull.end()-1);

double perimeter = 0;
for (size_t i = 0; i < upperHull.size() - 1; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ bool validate(Context *ctx) {
correctSparseAxpy(alpha, x, y, correct);

// compute test result
test.clear();
sparseAxpy(alpha, x, y, test);
SYNC();

Expand Down