GCC Code Coverage Report


Directory: ./
File: tasks/maslova_u_row_matr_vec_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: 18 32 56.2%

Line Branch Exec Source
1 #include "maslova_u_row_matr_vec_mult/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "maslova_u_row_matr_vec_mult/common/include/common.hpp"
7
8 namespace maslova_u_row_matr_vec_mult {
9
10
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 MaslovaURowMatrVecMultSEQ::MaslovaURowMatrVecMultSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 GetInput() = in;
13 56 }
14
15
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 bool MaslovaURowMatrVecMultSEQ::ValidationImpl() {
16 const auto &matrix = GetInput().first;
17 const auto &vec = GetInput().second;
18
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 if (matrix.data.empty()) {
19 return true;
20 }
21
2/4
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 56 times.
✗ Branch 3 not taken.
56 return (matrix.cols == vec.size()) && (matrix.data.size() == matrix.rows * matrix.cols);
22 }
23
24
1/2
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
56 bool MaslovaURowMatrVecMultSEQ::PreProcessingImpl() {
25 const auto &matrix = GetInput().first;
26
2/4
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 56 times.
✗ Branch 3 not taken.
56 if (!matrix.data.empty() && matrix.rows > 0) {
27 56 GetOutput().assign(matrix.rows, 0.0);
28 }
29 56 return true;
30 }
31
32
1/2
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
56 bool MaslovaURowMatrVecMultSEQ::RunImpl() {
33 const auto &matrix = GetInput().first;
34 const auto &vec = GetInput().second;
35
36
3/6
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 56 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 56 times.
✗ Branch 5 not taken.
56 if (matrix.data.empty() || matrix.rows == 0 || matrix.cols == 0) {
37 return true;
38 }
39
40 auto &res = GetOutput();
41
42
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 if (res.size() != matrix.rows) {
43 res.assign(matrix.rows, 0.0);
44 }
45
46
2/2
✓ Branch 0 taken 120 times.
✓ Branch 1 taken 56 times.
176 for (size_t i = 0; i < matrix.rows; ++i) {
47 double sum = 0.0;
48 120 const size_t offset = i * matrix.cols;
49
2/2
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 120 times.
376 for (size_t j = 0; j < matrix.cols; ++j) {
50 256 sum += matrix.data[offset + j] * vec[j];
51 }
52 120 res[i] = sum;
53 }
54
55 return true;
56 }
57
58 56 bool MaslovaURowMatrVecMultSEQ::PostProcessingImpl() {
59 56 return true;
60 }
61
62 } // namespace maslova_u_row_matr_vec_mult
63