GCC Code Coverage Report


Directory: ./
File: tasks/lopatin_a_scalar_mult/seq/src/ops_seq.cpp
Date: 2026-01-09 01:27:18
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 5 5 100.0%
Branches: 7 12 58.3%

Line Branch Exec Source
1 #include "lopatin_a_scalar_mult/seq/include/ops_seq.hpp"
2
3 #include <cstdint>
4 #include <vector>
5
6 #include "lopatin_a_scalar_mult/common/include/common.hpp"
7
8 namespace lopatin_a_scalar_mult {
9
10
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 LopatinAScalarMultSEQ::LopatinAScalarMultSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 24 GetOutput() = 0.0;
14 24 }
15
16
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 bool LopatinAScalarMultSEQ::ValidationImpl() {
17
3/6
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 24 times.
24 return (!GetInput().first.empty() && !GetInput().second.empty()) &&
18 24 (GetInput().first.size() == GetInput().second.size());
19 }
20
21 24 bool LopatinAScalarMultSEQ::PreProcessingImpl() {
22 24 GetOutput() = 0.0;
23 24 return (GetOutput() == 0.0);
24 }
25
26 24 bool LopatinAScalarMultSEQ::RunImpl() {
27 const auto &input = GetInput();
28 const auto n = static_cast<uint64_t>(input.first.size());
29 OutType &res = GetOutput();
30
31
2/2
✓ Branch 0 taken 216 times.
✓ Branch 1 taken 24 times.
240 for (uint64_t i = 0; i < n; ++i) {
32 216 res += input.first[i] * input.second[i];
33 }
34
35 24 return true;
36 }
37
38 24 bool LopatinAScalarMultSEQ::PostProcessingImpl() {
39 24 return true;
40 }
41
42 } // namespace lopatin_a_scalar_mult
43