| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "orehov_n_jarvis_pass/common/include/common.hpp" | ||
| 7 | #include "task/include/task.hpp" | ||
| 8 | |||
| 9 | namespace orehov_n_jarvis_pass { | ||
| 10 | |||
| 11 | class OrehovNJarvisPassALL : public BaseTask { | ||
| 12 | public: | ||
| 13 | static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { | ||
| 14 | return ppc::task::TypeOfTask::kALL; | ||
| 15 | } | ||
| 16 | explicit OrehovNJarvisPassALL(const InType &in); | ||
| 17 | |||
| 18 | [[nodiscard]] static double CheckLeft(Point a, Point b, Point c); | ||
| 19 | [[nodiscard]] static double Distance(Point a, Point b); | ||
| 20 | |||
| 21 | private: | ||
| 22 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
15 | struct BestState { |
| 23 | Point point; | ||
| 24 | bool valid = false; | ||
| 25 | }; | ||
| 26 | |||
| 27 | bool ValidationImpl() override; | ||
| 28 | bool PreProcessingImpl() override; | ||
| 29 | bool RunImpl() override; | ||
| 30 | bool PostProcessingImpl() override; | ||
| 31 | |||
| 32 | [[nodiscard]] Point FindFirstElem() const; | ||
| 33 | [[nodiscard]] Point FindNext(Point current) const; | ||
| 34 | |||
| 35 | [[nodiscard]] static bool IsBetterPoint(const Point ¤t, const Point &candidate, const Point &best); | ||
| 36 | [[nodiscard]] static BestState ReduceBestStates(const BestState &a, const BestState &b, const Point ¤t); | ||
| 37 | |||
| 38 | [[nodiscard]] BestState LocalFindBest(const Point ¤t, size_t start, size_t end) const; | ||
| 39 | [[nodiscard]] static BestState GlobalReduce(const std::vector<double> &all_data, int size, const Point ¤t); | ||
| 40 | [[nodiscard]] static BestState FinalizeBestPoint(const double *global_data); | ||
| 41 | |||
| 42 | std::vector<Point> res_; | ||
| 43 | std::vector<Point> input_; | ||
| 44 | }; | ||
| 45 | |||
| 46 | } // namespace orehov_n_jarvis_pass | ||
| 47 |