| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "otcheskov_s_elem_vec_avg/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cmath> | ||
| 4 | #include <cstdint> | ||
| 5 | #include <numeric> | ||
| 6 | |||
| 7 | #include "otcheskov_s_elem_vec_avg/common/include/common.hpp" | ||
| 8 | |||
| 9 | namespace otcheskov_s_elem_vec_avg { | ||
| 10 | |||
| 11 |
1/2✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
|
72 | OtcheskovSElemVecAvgSEQ::OtcheskovSElemVecAvgSEQ(const InType &in) { |
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 |
1/2✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
|
72 | GetInput() = in; |
| 14 | 72 | GetOutput() = NAN; | |
| 15 | 72 | } | |
| 16 | |||
| 17 |
2/2✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
|
72 | bool OtcheskovSElemVecAvgSEQ::ValidationImpl() { |
| 18 |
4/4✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 56 times.
|
72 | return (!GetInput().empty() && std::isnan(GetOutput())); |
| 19 | } | ||
| 20 | |||
| 21 | 72 | bool OtcheskovSElemVecAvgSEQ::PreProcessingImpl() { | |
| 22 | 72 | return true; | |
| 23 | } | ||
| 24 | |||
| 25 |
2/2✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
|
72 | bool OtcheskovSElemVecAvgSEQ::RunImpl() { |
| 26 |
2/2✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
|
72 | if (GetInput().empty()) { |
| 27 | return false; | ||
| 28 | } | ||
| 29 | |||
| 30 | int64_t sum = std::reduce(GetInput().begin(), GetInput().end(), int64_t{0}); | ||
| 31 | 64 | GetOutput() = static_cast<double>(sum) / static_cast<double>(GetInput().size()); | |
| 32 | 64 | return !std::isnan(GetOutput()); | |
| 33 | } | ||
| 34 | |||
| 35 | 72 | bool OtcheskovSElemVecAvgSEQ::PostProcessingImpl() { | |
| 36 | 72 | return true; | |
| 37 | } | ||
| 38 | |||
| 39 | } // namespace otcheskov_s_elem_vec_avg | ||
| 40 |