GCC Code Coverage Report


Directory: ./
File: tasks/fatehov_k_reshetka_tor/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 25 26 96.2%
Functions: 5 5 100.0%
Branches: 15 26 57.7%

Line Branch Exec Source
1 #include "fatehov_k_reshetka_tor/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <cmath>
5 #include <complex>
6 #include <vector>
7
8 #include "fatehov_k_reshetka_tor/common/include/common.hpp"
9
10 namespace fatehov_k_reshetka_tor {
11
12
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 FatehovKReshetkaTorSEQ::FatehovKReshetkaTorSEQ(const InType &in) {
13 SetTypeOfTask(GetStaticTypeOfTask());
14 GetInput() = in;
15 24 GetOutput() = 0;
16 24 }
17
18 24 bool FatehovKReshetkaTorSEQ::ValidationImpl() {
19 auto &data = GetInput();
20
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 return (std::get<0>(data) > 0 && std::get<0>(data) <= kMaxRows) &&
21
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
24 (std::get<1>(data) > 0 && std::get<1>(data) <= kMaxCols) &&
22
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 (std::get<0>(data) * std::get<1>(data) <= kMaxMatrixSize) &&
23
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 (std::get<2>(data).size() <= kMaxMatrixSize &&
24
2/4
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
48 std::get<2>(data).size() == std::get<0>(data) * std::get<1>(data)) &&
25 24 (!std::get<2>(data).empty());
26 }
27
28 24 bool FatehovKReshetkaTorSEQ::PreProcessingImpl() {
29 24 return true;
30 }
31
32 24 bool FatehovKReshetkaTorSEQ::RunImpl() {
33 auto &data = GetInput();
34 std::vector<double> &matrix = std::get<2>(data);
35 24 double global_max = -1e18;
36
2/2
✓ Branch 0 taken 368 times.
✓ Branch 1 taken 24 times.
392 for (double val : matrix) {
37 368 double heavy_val = val;
38
2/2
✓ Branch 0 taken 36800 times.
✓ Branch 1 taken 368 times.
37168 for (int k = 0; k < 100; ++k) {
39
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 36800 times.
36800 heavy_val = (std::sin(heavy_val) * std::cos(heavy_val)) + std::exp(std::complex<double>(0, heavy_val).real()) +
40
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 36800 times.
36800 std::sqrt(std::abs(heavy_val) + 1.0);
41
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 36800 times.
36800 if (std::isinf(heavy_val)) {
42 heavy_val = val;
43 }
44 }
45
46 368 global_max = std::max(heavy_val, global_max);
47 }
48 24 GetOutput() = global_max;
49 24 return true;
50 }
51
52 24 bool FatehovKReshetkaTorSEQ::PostProcessingImpl() {
53 24 return true;
54 }
55
56 } // namespace fatehov_k_reshetka_tor
57