GCC Code Coverage Report


Directory: ./
File: tasks/sabutay_sparse_complex_ccs_mult_all/stl/src/ops_stl.cpp
Date: 2026-06-04 20:25:32
Exec Total Coverage
Lines: 22 24 91.7%
Functions: 6 7 85.7%
Branches: 18 34 52.9%

Line Branch Exec Source
1 #include "sabutay_sparse_complex_ccs_mult_all/stl/include/ops_stl.hpp"
2
3 #include <algorithm>
4 #include <cstddef>
5 #include <utility>
6
7 #include "sabutay_sparse_complex_ccs_mult_all/all/include/ops_all.hpp"
8 #include "sabutay_sparse_complex_ccs_mult_all/common/include/common.hpp"
9 #include "task/include/task.hpp"
10
11 namespace sabutay_sparse_complex_ccs_mult_all {
12 namespace {
13 12 auto IsValidStructure(const CCS &matrix) -> bool {
14
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
12 if (matrix.row_count < 0 || matrix.col_count < 0) {
15 return false;
16 }
17
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
12 if (matrix.col_start.size() != (static_cast<std::size_t>(matrix.col_count) + 1U)) {
18 return false;
19 }
20
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
12 if (matrix.row_index.size() != matrix.nz.size()) {
21 return false;
22 }
23
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
12 if (matrix.col_start.empty() || matrix.col_start.front() != 0) {
24 return false;
25 }
26
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
12 if (!std::cmp_equal(matrix.col_start.back(), matrix.nz.size())) {
27 return false;
28 }
29
2/2
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 12 times.
38 for (int j = 0; j < matrix.col_count; ++j) {
30
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 26 times.
26 const auto col_idx = static_cast<std::size_t>(j);
31
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 26 times.
26 if (matrix.col_start[col_idx] > matrix.col_start[col_idx + 1U]) {
32 return false;
33 }
34 }
35
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 36 times.
36 return std::ranges::all_of(matrix.row_index, [&matrix](int row) { return row >= 0 && row < matrix.row_count; });
36 }
37 } // namespace
38
39
1/2
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
6 SabutaySparseComplexCcsMultSTL::SabutaySparseComplexCcsMultSTL(const InType &in) {
40 SetTypeOfTask(GetStaticTypeOfTask());
41 GetInput() = in;
42
1/2
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
6 GetOutput() = CCS();
43 6 }
44
45 void SabutaySparseComplexCcsMultSTL::BuildProductMatrix(const CCS &left, const CCS &right, CCS &out) {
46 6 SabutaySparseComplexCcsMultAll::BuildProductMatrix(left, right, out, ppc::task::TypeOfTask::kSTL);
47 }
48
49
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 bool SabutaySparseComplexCcsMultSTL::ValidationImpl() {
50 const CCS &left = std::get<0>(GetInput());
51 const CCS &right = std::get<1>(GetInput());
52
2/4
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
6 return left.col_count == right.row_count && IsValidStructure(left) && IsValidStructure(right);
53 }
54
55 6 bool SabutaySparseComplexCcsMultSTL::PreProcessingImpl() {
56 6 return true;
57 }
58
59 6 bool SabutaySparseComplexCcsMultSTL::RunImpl() {
60 const CCS &left = std::get<0>(GetInput());
61 const CCS &right = std::get<1>(GetInput());
62 BuildProductMatrix(left, right, GetOutput());
63 6 return true;
64 }
65
66 6 bool SabutaySparseComplexCcsMultSTL::PostProcessingImpl() {
67 6 return true;
68 }
69
70 } // namespace sabutay_sparse_complex_ccs_mult_all
71