GCC Code Coverage Report


Directory: ./
File: tasks/rozenberg_a_matrix_column_sum/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 17 17 100.0%
Functions: 5 5 100.0%
Branches: 10 14 71.4%

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