| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "shemetov_d_find_error_vec/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "shemetov_d_find_error_vec/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace shemetov_d_find_error_vec { | ||
| 9 | |||
| 10 | namespace { | ||
| 11 | constexpr double kEpsilon = 1e-10; | ||
| 12 | } // namespace | ||
| 13 | |||
| 14 |
1/2✓ Branch 1 taken 112 times.
✗ Branch 2 not taken.
|
112 | ShemetovDFindErrorVecSEQ::ShemetovDFindErrorVecSEQ(const InType &input) { |
| 15 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 16 |
1/2✓ Branch 1 taken 112 times.
✗ Branch 2 not taken.
|
112 | GetInput() = input; |
| 17 | 112 | GetOutput() = 0; | |
| 18 | 112 | } | |
| 19 | |||
| 20 | 112 | bool ShemetovDFindErrorVecSEQ::ValidationImpl() { | |
| 21 | 112 | return true; | |
| 22 | } | ||
| 23 | |||
| 24 | 112 | bool ShemetovDFindErrorVecSEQ::PreProcessingImpl() { | |
| 25 | 112 | return true; | |
| 26 | } | ||
| 27 | |||
| 28 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 96 times.
|
112 | bool ShemetovDFindErrorVecSEQ::RunImpl() { |
| 29 | const auto &data = GetInput(); | ||
| 30 | const size_t size = data.size(); | ||
| 31 | |||
| 32 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 96 times.
|
112 | if (size < 2) { |
| 33 | 16 | GetOutput() = 0; | |
| 34 | 16 | return true; | |
| 35 | } | ||
| 36 | |||
| 37 | int violations = 0; | ||
| 38 | |||
| 39 |
2/2✓ Branch 0 taken 8256 times.
✓ Branch 1 taken 96 times.
|
8352 | for (size_t i = 0; i + 1 < size; i += 1) { |
| 40 |
2/2✓ Branch 0 taken 104 times.
✓ Branch 1 taken 8152 times.
|
8256 | if (data[i] > data[i + 1] + kEpsilon) { |
| 41 | 104 | violations += 1; | |
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | 96 | GetOutput() = violations; | |
| 46 | 96 | return true; | |
| 47 | } | ||
| 48 | |||
| 49 | 112 | bool ShemetovDFindErrorVecSEQ::PostProcessingImpl() { | |
| 50 | 112 | return true; | |
| 51 | } | ||
| 52 | |||
| 53 | } // namespace shemetov_d_find_error_vec | ||
| 54 |