| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cmath> | ||
| 4 | #include <cstdlib> | ||
| 5 | #include <tuple> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "task/include/task.hpp" | ||
| 9 | |||
| 10 | namespace iskhakov_d_graham_convex_hull { | ||
| 11 | |||
| 12 | struct Point { | ||
| 13 | double x = 0.0; | ||
| 14 | double y = 0.0; | ||
| 15 | |||
| 16 | 272 | explicit Point(double x_coord = 0, double y_coord = 0) : x(x_coord), y(y_coord) {} | |
| 17 | |||
| 18 | bool operator<(const Point &other) const { | ||
| 19 | return std::tie(y, x) < std::tie(other.y, other.x); | ||
| 20 | } | ||
| 21 | |||
| 22 | bool operator==(const Point &other) const { | ||
| 23 | static constexpr double kEpsilon = 1e-9; | ||
| 24 | return std::abs(x - other.x) < kEpsilon && std::abs(y - other.y) < kEpsilon; | ||
| 25 | } | ||
| 26 | }; | ||
| 27 | |||
| 28 | using InType = std::vector<Point>; | ||
| 29 | using OutType = std::vector<Point>; | ||
| 30 | using TestType = std::tuple<InType, OutType>; | ||
| 31 | |||
| 32 | using BaseTask = ppc::task::Task<InType, OutType>; | ||
| 33 | |||
| 34 | } // namespace iskhakov_d_graham_convex_hull | ||
| 35 |