GCC Code Coverage Report


Directory: ./
File: tasks/lukin_i_cannon_algorithm/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 20 20 100.0%
Functions: 5 5 100.0%
Branches: 11 16 68.8%

Line Branch Exec Source
1 #include "lukin_i_cannon_algorithm/seq/include/ops_seq.hpp"
2
3 #include <cmath>
4 #include <cstddef>
5 #include <tuple>
6 #include <utility>
7 #include <vector>
8
9 #include "lukin_i_cannon_algorithm/common/include/common.hpp"
10
11 namespace lukin_i_cannon_algorithm {
12
13
1/2
✓ Branch 1 taken 32 times.
✗ Branch 2 not taken.
32 LukinICannonAlgorithmSEQ::LukinICannonAlgorithmSEQ(const InType &in) {
14 SetTypeOfTask(GetStaticTypeOfTask());
15 GetInput() = in;
16 GetOutput() = {};
17 32 }
18
19
1/2
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
32 bool LukinICannonAlgorithmSEQ::ValidationImpl() {
20 32 int rsize_a = static_cast<int>(std::get<0>(GetInput()).size());
21 32 int rsize_b = static_cast<int>(std::get<1>(GetInput()).size());
22 32 int size = std::get<2>(GetInput());
23
3/6
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 32 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 32 times.
32 return (rsize_a > 0) && (rsize_b > 0) && (sqrt(rsize_a) == size) && (rsize_a == rsize_b);
24 }
25
26 32 bool LukinICannonAlgorithmSEQ::PreProcessingImpl() {
27 32 return true;
28 }
29
30 32 bool LukinICannonAlgorithmSEQ::RunImpl() {
31 double *a = std::get<0>(GetInput()).data();
32 double *b = std::get<1>(GetInput()).data();
33 32 size_ = std::get<2>(GetInput());
34
35 32 std::vector<double> c(static_cast<size_t>(size_ * size_), 0);
36 double *cdata = c.data();
37
38
2/2
✓ Branch 0 taken 208 times.
✓ Branch 1 taken 32 times.
240 for (int i = 0; i < size_; i++) {
39
2/2
✓ Branch 0 taken 1824 times.
✓ Branch 1 taken 208 times.
2032 for (int k = 0; k < size_; k++) {
40 1824 double fixed = a[(i * size_) + k];
41
2/2
✓ Branch 0 taken 18496 times.
✓ Branch 1 taken 1824 times.
20320 for (int j = 0; j < size_; j++) {
42 18496 cdata[(i * size_) + j] += fixed * b[(k * size_) + j];
43 }
44 }
45 }
46
47 GetOutput() = std::move(c);
48 32 return true;
49 }
50
51 32 bool LukinICannonAlgorithmSEQ::PostProcessingImpl() {
52 32 return true;
53 }
54
55 } // namespace lukin_i_cannon_algorithm
56