GCC Code Coverage Report


Directory: ./
File: tasks/shkenev_i_matvect_using_vertical_ribbon/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 21 21 100.0%
Functions: 5 5 100.0%
Branches: 14 22 63.6%

Line Branch Exec Source
1 #include "shkenev_i_matvect_using_vertical_ribbon/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "shkenev_i_matvect_using_vertical_ribbon/common/include/common.hpp"
7
8 namespace shkenev_i_matvect_using_vertical_ribbon {
9
10
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 ShkenevImatvectUsingVerticalRibbonSEQ::ShkenevImatvectUsingVerticalRibbonSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 InType temp_input = in;
13 GetInput().swap(temp_input);
14 64 GetOutput() = OutType{};
15 64 }
16
17
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
64 bool ShkenevImatvectUsingVerticalRibbonSEQ::ValidationImpl() {
18 const auto &input = GetInput();
19 const auto &matrix_a = input.first;
20 const auto &vector_b = input.second;
21
22
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
64 if (matrix_a.empty()) {
23 return false;
24 }
25
26 std::size_t rows_a = matrix_a.size();
27 std::size_t cols_a = matrix_a[0].size();
28
29
2/2
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 64 times.
208 for (std::size_t i = 0; i < rows_a; i++) {
30
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 144 times.
144 if (matrix_a[i].size() != cols_a) {
31 return false;
32 }
33 }
34
35
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
64 if (vector_b.empty()) {
36 return false;
37 }
38
39 64 return vector_b.size() == cols_a;
40 }
41
42
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
64 bool ShkenevImatvectUsingVerticalRibbonSEQ::PreProcessingImpl() {
43 GetOutput().clear();
44 64 return true;
45 }
46
47 64 bool ShkenevImatvectUsingVerticalRibbonSEQ::RunImpl() {
48 const auto &matrix_a = GetInput().first;
49 const auto &vector_b = GetInput().second;
50
51 std::size_t rows_a = matrix_a.size();
52 std::size_t cols_a = matrix_a[0].size();
53
54 64 std::vector<double> result_vector(rows_a, 0.0);
55
56
2/2
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 64 times.
208 for (std::size_t i = 0; i < rows_a; i++) {
57
2/2
✓ Branch 0 taken 416 times.
✓ Branch 1 taken 144 times.
560 for (std::size_t j = 0; j < cols_a; j++) {
58 416 result_vector[i] += matrix_a[i][j] * vector_b[j];
59 }
60 }
61
62
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 GetOutput() = result_vector;
63
64 64 return true;
65 }
66
67 64 bool ShkenevImatvectUsingVerticalRibbonSEQ::PostProcessingImpl() {
68 64 return true;
69 }
70
71 } // namespace shkenev_i_matvect_using_vertical_ribbon
72