| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "titaev_m_avg_el_vector/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include "titaev_m_avg_el_vector/common/include/common.hpp" | ||
| 4 | |||
| 5 | namespace titaev_m_avg_el_vector { | ||
| 6 | |||
| 7 |
1/2✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
|
24 | TitaevMElemVecsAvgSEQ::TitaevMElemVecsAvgSEQ(const InType &in) { |
| 8 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 9 |
1/2✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
|
24 | GetInput() = in; |
| 10 | 24 | GetOutput() = 0.0; | |
| 11 | 24 | } | |
| 12 | |||
| 13 | 24 | bool TitaevMElemVecsAvgSEQ::ValidationImpl() { | |
| 14 | 24 | return !GetInput().empty(); | |
| 15 | } | ||
| 16 | |||
| 17 | 24 | bool TitaevMElemVecsAvgSEQ::PreProcessingImpl() { | |
| 18 | 24 | return true; | |
| 19 | } | ||
| 20 | |||
| 21 | 24 | bool TitaevMElemVecsAvgSEQ::RunImpl() { | |
| 22 | const auto &vec = GetInput(); | ||
| 23 | double sum = 0.0; | ||
| 24 | |||
| 25 |
2/2✓ Branch 0 taken 120 times.
✓ Branch 1 taken 24 times.
|
144 | for (int v : vec) { |
| 26 | 120 | sum += v; | |
| 27 | } | ||
| 28 | |||
| 29 | 24 | GetOutput() = sum / static_cast<double>(vec.size()); | |
| 30 | 24 | return true; | |
| 31 | } | ||
| 32 | |||
| 33 | 24 | bool TitaevMElemVecsAvgSEQ::PostProcessingImpl() { | |
| 34 | 24 | return true; | |
| 35 | } | ||
| 36 | |||
| 37 | } // namespace titaev_m_avg_el_vector | ||
| 38 |