GCC Code Coverage Report


Directory: ./
File: tasks/sannikov_i_column_sum/seq/src/ops_seq.cpp
Date: 2025-12-13 04:24:21
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 5 5 100.0%
Branches: 13 20 65.0%

Line Branch Exec Source
1 #include "sannikov_i_column_sum/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "sannikov_i_column_sum/common/include/common.hpp"
7 namespace sannikov_i_column_sum {
8
9
1/2
✓ Branch 1 taken 128 times.
✗ Branch 2 not taken.
128 SannikovIColumnSumSEQ::SannikovIColumnSumSEQ(const InType &in) {
10 SetTypeOfTask(GetStaticTypeOfTask());
11 auto &input_buffer = GetInput();
12
1/2
✓ Branch 1 taken 128 times.
✗ Branch 2 not taken.
128 InType tmp(in);
13 input_buffer.swap(tmp);
14
15 GetOutput().clear();
16 128 }
17
18
1/2
✓ Branch 0 taken 128 times.
✗ Branch 1 not taken.
128 bool SannikovIColumnSumSEQ::ValidationImpl() {
19 const auto &input_matrix = GetInput();
20
2/4
✓ Branch 0 taken 128 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 128 times.
128 if (input_matrix.empty() || input_matrix.front().empty()) {
21 return false;
22 }
23
24 const std::size_t columns = input_matrix.front().size();
25
2/2
✓ Branch 0 taken 384 times.
✓ Branch 1 taken 128 times.
512 for (const auto &row : input_matrix) {
26
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 384 times.
384 if (row.size() != columns) {
27 return false;
28 }
29 }
30
31 128 return GetOutput().empty();
32 }
33
34
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 bool SannikovIColumnSumSEQ::PreProcessingImpl() {
35 const auto &input_matrix = GetInput();
36 GetOutput().clear();
37 128 GetOutput().resize(input_matrix.front().size(), 0);
38 128 return !GetOutput().empty();
39 }
40
41 128 bool SannikovIColumnSumSEQ::RunImpl() {
42 const auto &input_matrix = GetInput();
43
2/2
✓ Branch 0 taken 384 times.
✓ Branch 1 taken 128 times.
512 for (const auto &row : input_matrix) {
44 std::size_t column = 0;
45
2/2
✓ Branch 0 taken 1008 times.
✓ Branch 1 taken 384 times.
1392 for (const auto &value : row) {
46 1008 GetOutput()[column] += value;
47 1008 column++;
48 }
49 }
50 128 return !GetOutput().empty();
51 }
52
53 128 bool SannikovIColumnSumSEQ::PostProcessingImpl() {
54 128 return !GetOutput().empty();
55 }
56
57 } // namespace sannikov_i_column_sum
58