GCC Code Coverage Report


Directory: ./
File: tasks/liulin_y_vert_strip_diag_matrix_vect_mult/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 20 21 95.2%
Functions: 5 5 100.0%
Branches: 15 26 57.7%

Line Branch Exec Source
1 #include "liulin_y_vert_strip_diag_matrix_vect_mult/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "liulin_y_vert_strip_diag_matrix_vect_mult/common/include/common.hpp"
7
8 namespace liulin_y_vert_strip_diag_matrix_vect_mult {
9
10
1/2
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
80 LiulinYVertStripDiagMatrixVectMultSEQ::LiulinYVertStripDiagMatrixVectMultSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
13 auto &matrix = std::get<0>(GetInput());
14 auto &vect = std::get<1>(GetInput());
15
16 const auto &input_matrix = std::get<0>(in);
17 const auto &input_vect = std::get<1>(in);
18
19 matrix.clear();
20 vect.clear();
21
22
1/2
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
80 if (!input_matrix.empty()) {
23
1/2
✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
80 matrix = input_matrix;
24 }
25
26
1/2
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
80 if (!input_vect.empty()) {
27
1/2
✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
80 vect = input_vect;
28 }
29
30 GetOutput().clear();
31 80 }
32
33 80 bool LiulinYVertStripDiagMatrixVectMultSEQ::ValidationImpl() {
34 const auto &input = GetInput();
35 const auto &matrix = std::get<0>(input);
36 const auto &vect = std::get<1>(input);
37
38 if (matrix.empty() && vect.empty()) {
39 return true;
40 }
41
42 return true;
43 }
44
45
1/2
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
80 bool LiulinYVertStripDiagMatrixVectMultSEQ::PreProcessingImpl() {
46 const auto &input = GetInput();
47 const auto &matrix = std::get<0>(input);
48
49
2/4
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 80 times.
80 if (matrix.empty() || matrix[0].empty()) {
50 GetOutput().clear();
51 return true;
52 }
53
54 const std::size_t rows = matrix.size();
55 80 GetOutput().assign(rows, 0);
56 80 return true;
57 }
58
59
1/2
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
80 bool LiulinYVertStripDiagMatrixVectMultSEQ::RunImpl() {
60 const auto &input = GetInput();
61 const auto &matrix = std::get<0>(input);
62 const auto &vect = std::get<1>(input);
63 auto &out = GetOutput();
64
65
2/4
✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 80 times.
✗ Branch 3 not taken.
80 if (matrix.empty() || matrix[0].empty()) {
66 return true;
67 }
68
69 80 const int rows = static_cast<int>(matrix.size());
70 80 const int cols = static_cast<int>(matrix[0].size());
71
72
2/2
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 80 times.
272 for (int i = 0; i < rows; ++i) {
73
2/2
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 192 times.
704 for (int j = 0; j < cols; ++j) {
74 512 out[i] += matrix[i][j] * vect[j];
75 }
76 }
77
78 return true;
79 }
80
81 80 bool LiulinYVertStripDiagMatrixVectMultSEQ::PostProcessingImpl() {
82 80 return true;
83 }
84
85 } // namespace liulin_y_vert_strip_diag_matrix_vect_mult
86