| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "olesnitskiy_v_find_viol/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <vector> | ||
| 4 | |||
| 5 | #include "olesnitskiy_v_find_viol/common/include/common.hpp" | ||
| 6 | |||
| 7 | namespace olesnitskiy_v_find_viol { | ||
| 8 | |||
| 9 |
1/2✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
80 | OlesnitskiyVFindViolSEQ::OlesnitskiyVFindViolSEQ(const InType &in) { |
| 10 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 11 |
1/2✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
80 | GetInput() = in; |
| 12 | 80 | GetOutput() = 0; | |
| 13 | 80 | } | |
| 14 | |||
| 15 | 80 | bool OlesnitskiyVFindViolSEQ::ValidationImpl() { | |
| 16 | 80 | return true; //! GetInput().empty() проверка на то, что вектор не пустой, но я решил что это не ошибка | |
| 17 | } | ||
| 18 | |||
| 19 | 80 | bool OlesnitskiyVFindViolSEQ::PreProcessingImpl() { | |
| 20 | 80 | return true; | |
| 21 | } | ||
| 22 | |||
| 23 | 80 | bool OlesnitskiyVFindViolSEQ::RunImpl() { | |
| 24 |
2/2✓ Branch 0 taken 64 times.
✓ Branch 1 taken 16 times.
|
80 | GetOutput() = 0; |
| 25 | |||
| 26 |
2/2✓ Branch 0 taken 64 times.
✓ Branch 1 taken 16 times.
|
80 | if (GetInput().size() >= 2) { |
| 27 | const double epsilon = 1e-10; | ||
| 28 |
2/2✓ Branch 0 taken 184 times.
✓ Branch 1 taken 64 times.
|
248 | for (auto it = GetInput().begin(); it < GetInput().end() - 1; |
| 29 | it++) { // использовал auto чтобы без проблем перейти на double | ||
| 30 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 112 times.
|
184 | if (*it - *(it + 1) > epsilon) { |
| 31 | 72 | GetOutput()++; | |
| 32 | } | ||
| 33 | } | ||
| 34 | } | ||
| 35 | 80 | return true; | |
| 36 | } | ||
| 37 | |||
| 38 | 80 | bool OlesnitskiyVFindViolSEQ::PostProcessingImpl() { | |
| 39 | 80 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | } // namespace olesnitskiy_v_find_viol | ||
| 43 |