| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "vasiliev_m_vec_signs/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "vasiliev_m_vec_signs/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace vasiliev_m_vec_signs { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
|
40 | VasilievMVecSignsSEQ::VasilievMVecSignsSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 |
1/2✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
|
40 | GetInput() = in; |
| 13 | 40 | GetOutput() = OutType{}; | |
| 14 | 40 | } | |
| 15 | |||
| 16 | 40 | bool VasilievMVecSignsSEQ::ValidationImpl() { | |
| 17 | 40 | return !GetInput().empty(); | |
| 18 | } | ||
| 19 | |||
| 20 | 40 | bool VasilievMVecSignsSEQ::PreProcessingImpl() { | |
| 21 | 40 | GetOutput() = 0; | |
| 22 | 40 | return true; | |
| 23 | } | ||
| 24 | |||
| 25 | 40 | bool VasilievMVecSignsSEQ::RunImpl() { | |
| 26 | auto &vec = GetInput(); | ||
| 27 | int alters = 0; | ||
| 28 | |||
| 29 |
2/2✓ Branch 0 taken 936 times.
✓ Branch 1 taken 40 times.
|
976 | for (size_t i = 0; i < (vec.size() - 1); i++) { |
| 30 |
8/8✓ Branch 0 taken 576 times.
✓ Branch 1 taken 360 times.
✓ Branch 2 taken 368 times.
✓ Branch 3 taken 208 times.
✓ Branch 4 taken 344 times.
✓ Branch 5 taken 384 times.
✓ Branch 6 taken 200 times.
✓ Branch 7 taken 144 times.
|
936 | if ((vec[i] > 0 && vec[i + 1] < 0) || (vec[i] < 0 && vec[i + 1] > 0)) { |
| 31 | 408 | alters++; | |
| 32 | } | ||
| 33 | } | ||
| 34 | |||
| 35 | 40 | GetOutput() = alters; | |
| 36 | 40 | return true; | |
| 37 | } | ||
| 38 | |||
| 39 | 40 | bool VasilievMVecSignsSEQ::PostProcessingImpl() { | |
| 40 | 40 | return GetOutput() >= 0; | |
| 41 | } | ||
| 42 | |||
| 43 | } // namespace vasiliev_m_vec_signs | ||
| 44 |