GCC Code Coverage Report


Directory: ./
File: tasks/makovskiy_i_min_value_in_matrix_rows/seq/src/ops_seq.cpp
Date: 2025-12-13 04:24:21
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 5 5 100.0%
Branches: 8 14 57.1%

Line Branch Exec Source
1 #include "makovskiy_i_min_value_in_matrix_rows/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <cstddef>
5 #include <vector>
6
7 #include "makovskiy_i_min_value_in_matrix_rows/common/include/common.hpp"
8
9 namespace makovskiy_i_min_value_in_matrix_rows {
10
11
1/2
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
48 MinValueSEQ::MinValueSEQ(const InType &in) {
12
1/2
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
48 InType temp(in);
13 this->GetInput().swap(temp);
14 SetTypeOfTask(GetStaticTypeOfTask());
15 48 }
16
17
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
48 bool MinValueSEQ::ValidationImpl() {
18 const auto &mat = this->GetInput();
19
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
48 if (mat.empty()) {
20 return false;
21 }
22 return std::ranges::all_of(mat, [](const auto &row) { return !row.empty(); });
23 }
24
25
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
48 bool MinValueSEQ::PreProcessingImpl() {
26 const auto &mat = this->GetInput();
27 this->GetOutput().clear();
28 48 this->GetOutput().resize(mat.size());
29 48 return true;
30 }
31
32 48 bool MinValueSEQ::RunImpl() {
33 const auto &mat = this->GetInput();
34 auto &out = this->GetOutput();
35
2/2
✓ Branch 0 taken 112 times.
✓ Branch 1 taken 48 times.
160 for (size_t i = 0; i < mat.size(); ++i) {
36 const auto &row = mat[i];
37
1/2
✓ Branch 0 taken 112 times.
✗ Branch 1 not taken.
112 if (!row.empty()) {
38 112 out[i] = *std::ranges::min_element(row);
39 }
40 }
41 48 return true;
42 }
43
44 48 bool MinValueSEQ::PostProcessingImpl() {
45 48 return true;
46 }
47
48 } // namespace makovskiy_i_min_value_in_matrix_rows
49