GCC Code Coverage Report


Directory: ./
File: tasks/melnik_i_matrix_mult_ribbon/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 17 17 100.0%
Functions: 5 5 100.0%
Branches: 13 20 65.0%

Line Branch Exec Source
1 #include "melnik_i_matrix_mult_ribbon/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "melnik_i_matrix_mult_ribbon/common/include/common.hpp"
7
8 namespace melnik_i_matrix_mult_ribbon {
9
10
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 MelnikIMatrixMultRibbonSEQ::MelnikIMatrixMultRibbonSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 72 GetOutput() = std::vector<std::vector<double>>();
14 72 }
15
16
1/2
✓ Branch 0 taken 72 times.
✗ Branch 1 not taken.
72 bool MelnikIMatrixMultRibbonSEQ::ValidationImpl() {
17 const auto &matrix_a = std::get<0>(GetInput());
18 const auto &matrix_b = std::get<1>(GetInput());
19
20
3/6
✓ Branch 0 taken 72 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 72 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 72 times.
72 return !matrix_a.empty() && !matrix_b.empty() && matrix_a[0].size() == matrix_b.size();
21 }
22
23
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 72 times.
72 bool MelnikIMatrixMultRibbonSEQ::PreProcessingImpl() {
24 GetOutput().clear();
25 72 return true;
26 }
27
28 72 bool MelnikIMatrixMultRibbonSEQ::RunImpl() {
29 const auto &matrix_a = std::get<0>(GetInput());
30 const auto &matrix_b = std::get<1>(GetInput());
31
32 size_t rows_a = matrix_a.size();
33 size_t cols_a = matrix_a[0].size();
34 size_t cols_b = matrix_b[0].size();
35
36 auto &output = GetOutput();
37
1/2
✓ Branch 2 taken 72 times.
✗ Branch 3 not taken.
72 output = std::vector<std::vector<double>>(rows_a, std::vector<double>(cols_b, 0.0));
38
39
2/2
✓ Branch 0 taken 352 times.
✓ Branch 1 taken 72 times.
424 for (size_t i = 0; i < rows_a; i++) {
40
2/2
✓ Branch 0 taken 2048 times.
✓ Branch 1 taken 352 times.
2400 for (size_t k = 0; k < cols_a; k++) {
41 2048 double aik = matrix_a[i][k];
42
2/2
✓ Branch 0 taken 12128 times.
✓ Branch 1 taken 2048 times.
14176 for (size_t j = 0; j < cols_b; j++) {
43 12128 output[i][j] += aik * matrix_b[k][j];
44 }
45 }
46 }
47
48 72 return true;
49 }
50
51 72 bool MelnikIMatrixMultRibbonSEQ::PostProcessingImpl() {
52 72 return true;
53 }
54
55 } // namespace melnik_i_matrix_mult_ribbon
56