GCC Code Coverage Report


Directory: ./
File: tasks/gaivoronskiy_m_average_vector_sum/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 5 5 100.0%
Branches: 2 4 50.0%

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