GCC Code Coverage Report


Directory: ./
File: tasks/vector_scalar_product/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 14 14 100.0%
Functions: 5 5 100.0%
Branches: 4 8 50.0%

Line Branch Exec Source
1 #include "vector_scalar_product/seq/include/ops_seq.hpp"
2
3 #include <numeric>
4
5 #include "vector_scalar_product/common/include/common.hpp"
6
7 namespace vector_scalar_product {
8
9
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 VectorScalarProductSeq::VectorScalarProductSeq(const InType &in) {
10 SetTypeOfTask(GetStaticTypeOfTask());
11 GetInput() = in;
12 24 GetOutput() = 0.0;
13 24 }
14
15
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 bool VectorScalarProductSeq::ValidationImpl() {
16 const auto &lhs = GetInput().lhs;
17 const auto &rhs = GetInput().rhs;
18
2/4
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
24 return !lhs.empty() && lhs.size() == rhs.size();
19 }
20
21 24 bool VectorScalarProductSeq::PreProcessingImpl() {
22 24 partial_sum_ = 0.0;
23 24 return true;
24 }
25
26 24 bool VectorScalarProductSeq::RunImpl() {
27 const auto &lhs = GetInput().lhs;
28 const auto &rhs = GetInput().rhs;
29 24 partial_sum_ = std::inner_product(lhs.begin(), lhs.end(), rhs.begin(), 0.0);
30 24 return true;
31 }
32
33 24 bool VectorScalarProductSeq::PostProcessingImpl() {
34 24 GetOutput() = partial_sum_;
35 24 return true;
36 }
37
38 } // namespace vector_scalar_product
39