GCC Code Coverage Report


Directory: ./
File: tasks/peterson_r_graham_scan_omp/omp/include/ops_omp.hpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 0 1 0.0%
Functions: 0 0 -%
Branches: 0 0 -%

Line Branch Exec Source
1 #pragma once
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "peterson_r_graham_scan_omp/common/include/common.hpp"
7 #include "task/include/task.hpp"
8
9 namespace peterson_r_graham_scan_omp {
10
11 struct Point2D {
12 double coord_x;
13 double coord_y;
14
15 Point2D() = default;
16 Point2D(double x_val, double y_val) : coord_x(x_val), coord_y(y_val) {}
17 };
18
19 using PointSet = std::vector<Point2D>;
20
21 class PetersonGrahamScannerOMP : public ppc::task::Task<InputValue, OutputValue> {
22 public:
23 static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() {
24 return ppc::task::TypeOfTask::kOMP;
25 }
26
27 explicit PetersonGrahamScannerOMP(const InputValue &in);
28
29 void LoadPoints(const PointSet &points);
30 [[nodiscard]] PointSet GetConvexHull() const;
31
32 private:
33 bool ValidationImpl() override;
34 bool PreProcessingImpl() override;
35 bool RunImpl() override;
36 bool PostProcessingImpl() override;
37
38 PointSet input_points_;
39 PointSet hull_points_;
40 bool external_data_provided_ = false;
41
42 static double ComputeOrientation(const Point2D &origin, const Point2D &a, const Point2D &b);
43 static double ComputeDistanceSq(const Point2D &p1, const Point2D &p2);
44 static bool AreAllPointsIdentical(const PointSet &points);
45
46 static std::size_t FindLowestPointParallel(const PointSet &points);
47 static void SortPointsByAngleParallel(PointSet &points);
48 static void ParallelMergeSort(PointSet &points, int left, int right, const Point2D &origin);
49 };
50
51 } // namespace peterson_r_graham_scan_omp
52