GCC Code Coverage Report


Directory: ./
File: tasks/sinev_a_mult_matrix_fox_algorithm/seq/src/ops_seq.cpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 19 20 95.0%
Functions: 5 5 100.0%
Branches: 12 18 66.7%

Line Branch Exec Source
1 #include "sinev_a_mult_matrix_fox_algorithm/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "sinev_a_mult_matrix_fox_algorithm/common/include/common.hpp"
7
8 namespace sinev_a_mult_matrix_fox_algorithm_seq {
9
10
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 SinevAMultMatrixFoxAlgorithmSEQ::SinevAMultMatrixFoxAlgorithmSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 GetOutput() = {};
14 56 }
15
16 56 bool SinevAMultMatrixFoxAlgorithmSEQ::ValidationImpl() {
17 const auto &[matrix_size, matrix_a, matrix_b] = GetInput();
18
19
3/6
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 56 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 56 times.
56 return matrix_size > 0 && matrix_a.size() == matrix_size * matrix_size &&
20 56 matrix_b.size() == matrix_size * matrix_size;
21 }
22
23 56 bool SinevAMultMatrixFoxAlgorithmSEQ::PreProcessingImpl() {
24 const auto &[matrix_size, matrix_a, matrix_b] = GetInput();
25 56 GetOutput() = std::vector<double>(matrix_size * matrix_size, 0.0);
26 56 return true;
27 }
28
29 56 bool SinevAMultMatrixFoxAlgorithmSEQ::RunImpl() {
30 const auto &[matrix_size, matrix_a, matrix_b] = GetInput();
31
32
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 size_t n = matrix_size;
33 auto &output = GetOutput();
34
35
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 if (output.size() != n * n) {
36 output.assign(n * n, 0.0);
37 }
38
39
2/2
✓ Branch 0 taken 224 times.
✓ Branch 1 taken 56 times.
280 for (size_t i = 0; i < n; ++i) {
40
2/2
✓ Branch 0 taken 1120 times.
✓ Branch 1 taken 224 times.
1344 for (size_t j = 0; j < n; ++j) {
41 double sum = 0.0;
42
2/2
✓ Branch 0 taken 6272 times.
✓ Branch 1 taken 1120 times.
7392 for (size_t k = 0; k < n; ++k) {
43 6272 sum += matrix_a[(i * n) + k] * matrix_b[(k * n) + j];
44 }
45 1120 output[(i * n) + j] = sum;
46 }
47 }
48
49 56 return true;
50 }
51
52 56 bool SinevAMultMatrixFoxAlgorithmSEQ::PostProcessingImpl() {
53 56 return true;
54 }
55
56 } // namespace sinev_a_mult_matrix_fox_algorithm_seq
57