GCC Code Coverage Report


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

Line Branch Exec Source
1 #include "tochilin_e_vertical_ribbon_scheme/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <utility>
5 #include <vector>
6
7 #include "tochilin_e_vertical_ribbon_scheme/common/include/common.hpp"
8
9 namespace tochilin_e_vertical_ribbon_scheme {
10
11
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 TochilinEVerticalRibbonSchemeSEQ::TochilinEVerticalRibbonSchemeSEQ(const InType &in) {
12 SetTypeOfTask(GetStaticTypeOfTask());
13
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 GetInput() = in;
14 GetOutput() = {};
15 24 }
16
17 24 bool TochilinEVerticalRibbonSchemeSEQ::ValidationImpl() {
18 const auto &input = GetInput();
19
2/4
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
✗ Branch 3 not taken.
24 if (input.rows <= 0 || input.cols <= 0) {
20 return false;
21 }
22
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (std::cmp_not_equal(input.matrix.size(), static_cast<std::size_t>(input.rows) * input.cols)) {
23 return false;
24 }
25 if (std::cmp_not_equal(input.vector.size(), input.cols)) {
26 return false;
27 }
28 return true;
29 }
30
31 24 bool TochilinEVerticalRibbonSchemeSEQ::PreProcessingImpl() {
32 const auto &input = GetInput();
33 24 rows_ = input.rows;
34 24 cols_ = input.cols;
35 24 matrix_ = input.matrix;
36 24 vector_ = input.vector;
37 24 result_.assign(rows_, 0.0);
38 24 return true;
39 }
40
41 24 bool TochilinEVerticalRibbonSchemeSEQ::RunImpl() {
42
2/2
✓ Branch 0 taken 120 times.
✓ Branch 1 taken 24 times.
144 for (int j = 0; j < cols_; j++) {
43
2/2
✓ Branch 0 taken 664 times.
✓ Branch 1 taken 120 times.
784 for (int i = 0; i < rows_; i++) {
44 664 result_[i] += matrix_[static_cast<std::size_t>(j * rows_) + i] * vector_[j];
45 }
46 }
47 24 return true;
48 }
49
50 24 bool TochilinEVerticalRibbonSchemeSEQ::PostProcessingImpl() {
51 24 GetOutput() = result_;
52 24 return true;
53 }
54
55 } // namespace tochilin_e_vertical_ribbon_scheme
56