GCC Code Coverage Report


Directory: ./
File: tasks/klimenko_v_max_matrix_elems_val/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 22 22 100.0%
Functions: 5 5 100.0%
Branches: 15 18 83.3%

Line Branch Exec Source
1 #include "klimenko_v_max_matrix_elems_val/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <climits>
5 #include <vector>
6
7 #include "klimenko_v_max_matrix_elems_val/common/include/common.hpp"
8
9 namespace klimenko_v_max_matrix_elems_val {
10
11
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 KlimenkoVMaxMatrixElemsValSEQ::KlimenkoVMaxMatrixElemsValSEQ(const InType &in) {
12 SetTypeOfTask(GetStaticTypeOfTask());
13
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 GetInput() = InType(in);
14 56 GetOutput() = 0;
15 56 }
16
17
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 8 times.
56 bool KlimenkoVMaxMatrixElemsValSEQ::ValidationImpl() {
18
3/4
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 48 times.
56 if (GetInput().empty() || GetInput()[0].empty()) {
19 8 GetOutput() = 0;
20 }
21 56 return true;
22 }
23
24 56 bool KlimenkoVMaxMatrixElemsValSEQ::PreProcessingImpl() {
25 56 return GetOutput() == 0;
26 }
27
28
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 48 times.
56 bool KlimenkoVMaxMatrixElemsValSEQ::RunImpl() {
29 const auto &matrix = GetInput();
30
31
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 48 times.
56 if (matrix.empty()) {
32 8 GetOutput() = 0;
33 8 return true;
34 }
35
36 48 int max_element = matrix[0][0];
37
2/2
✓ Branch 0 taken 1008 times.
✓ Branch 1 taken 48 times.
1056 for (const auto &row : matrix) {
38
2/2
✓ Branch 0 taken 81472 times.
✓ Branch 1 taken 1008 times.
82480 for (int element : row) {
39 81472 max_element = std::max(element, max_element);
40 }
41 }
42
43 48 GetOutput() = max_element;
44 48 return true;
45 }
46
47 56 bool KlimenkoVMaxMatrixElemsValSEQ::PostProcessingImpl() {
48 56 return true;
49 }
50
51 } // namespace klimenko_v_max_matrix_elems_val
52