| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "chernykh_s_min_matrix_elements/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <algorithm> | ||
| 4 | #include <limits> | ||
| 5 | |||
| 6 | #include "chernykh_s_min_matrix_elements/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace chernykh_s_min_matrix_elements { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
|
48 | ChernykhSMinMatrixElementsSEQ::ChernykhSMinMatrixElementsSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 |
1/2✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
|
48 | GetInput() = InType(in); |
| 13 | 48 | GetOutput() = std::numeric_limits<double>::max(); | |
| 14 | 48 | } | |
| 15 | |||
| 16 | 48 | bool ChernykhSMinMatrixElementsSEQ::ValidationImpl() { | |
| 17 | 48 | return (GetOutput() == std::numeric_limits<double>::max()); | |
| 18 | } | ||
| 19 | |||
| 20 | 48 | bool ChernykhSMinMatrixElementsSEQ::PreProcessingImpl() { | |
| 21 | 48 | return true; | |
| 22 | } | ||
| 23 | |||
| 24 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 40 times.
|
48 | bool ChernykhSMinMatrixElementsSEQ::RunImpl() { |
| 25 | const auto &matrix = GetInput(); | ||
| 26 | |||
| 27 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 40 times.
|
48 | if (matrix.empty()) { |
| 28 | 8 | GetOutput() = std::numeric_limits<double>::max(); | |
| 29 | 8 | return true; | |
| 30 | } | ||
| 31 | 40 | double minimum = std::numeric_limits<double>::max(); | |
| 32 |
2/2✓ Branch 0 taken 1016 times.
✓ Branch 1 taken 40 times.
|
1056 | for (const auto &row : matrix) { |
| 33 |
2/2✓ Branch 0 taken 42896 times.
✓ Branch 1 taken 1016 times.
|
43912 | for (double element : row) { |
| 34 | 42896 | minimum = std::min(element, minimum); | |
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | 40 | GetOutput() = minimum; | |
| 39 | 40 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | 48 | bool ChernykhSMinMatrixElementsSEQ::PostProcessingImpl() { | |
| 43 | 48 | return true; | |
| 44 | ; | ||
| 45 | } | ||
| 46 | |||
| 47 | } // namespace chernykh_s_min_matrix_elements | ||
| 48 |