| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "kosolapov_v_max_values_in_col_matrix/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <algorithm> | ||
| 4 | #include <cstddef> | ||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "kosolapov_v_max_values_in_col_matrix/common/include/common.hpp" | ||
| 8 | |||
| 9 | namespace kosolapov_v_max_values_in_col_matrix { | ||
| 10 | |||
| 11 |
1/2✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
|
104 | KosolapovVMaxValuesInColMatrixSEQ::KosolapovVMaxValuesInColMatrixSEQ(const InType &in) { |
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 |
2/4✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 104 times.
✗ Branch 7 not taken.
|
104 | GetInput() = InType(in); |
| 14 | GetOutput() = {}; | ||
| 15 | 104 | } | |
| 16 | |||
| 17 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 104 times.
|
104 | bool KosolapovVMaxValuesInColMatrixSEQ::ValidationImpl() { |
| 18 | const auto &matrix = GetInput(); | ||
| 19 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 104 times.
|
104 | if (matrix.empty()) { |
| 20 | return false; | ||
| 21 | } | ||
| 22 |
2/2✓ Branch 0 taken 432 times.
✓ Branch 1 taken 104 times.
|
536 | for (size_t i = 0; i < matrix.size() - 1; i++) { |
| 23 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 432 times.
|
432 | if (matrix[i].size() != matrix[i + 1].size()) { |
| 24 | return false; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | 104 | return (GetOutput().empty()); | |
| 28 | } | ||
| 29 | |||
| 30 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 104 times.
|
104 | bool KosolapovVMaxValuesInColMatrixSEQ::PreProcessingImpl() { |
| 31 | GetOutput().clear(); | ||
| 32 | 104 | GetOutput().resize(GetInput()[0].size()); | |
| 33 | 104 | return true; | |
| 34 | } | ||
| 35 | |||
| 36 |
1/2✓ Branch 0 taken 104 times.
✗ Branch 1 not taken.
|
104 | bool KosolapovVMaxValuesInColMatrixSEQ::RunImpl() { |
| 37 | const auto &matrix = GetInput(); | ||
| 38 |
1/2✓ Branch 0 taken 104 times.
✗ Branch 1 not taken.
|
104 | if (matrix.empty()) { |
| 39 | return false; | ||
| 40 | } | ||
| 41 | |||
| 42 |
2/2✓ Branch 0 taken 552 times.
✓ Branch 1 taken 104 times.
|
656 | for (size_t i = 0; i < matrix[0].size(); i++) { |
| 43 | 552 | int temp_max = matrix[0][i]; | |
| 44 |
2/2✓ Branch 0 taken 4824 times.
✓ Branch 1 taken 552 times.
|
5376 | for (const auto &row : matrix) { |
| 45 | 4824 | temp_max = std::max(row[i], temp_max); | |
| 46 | } | ||
| 47 | 552 | GetOutput()[i] = temp_max; | |
| 48 | } | ||
| 49 | return true; | ||
| 50 | } | ||
| 51 | |||
| 52 | 104 | bool KosolapovVMaxValuesInColMatrixSEQ::PostProcessingImpl() { | |
| 53 | 104 | return true; | |
| 54 | } | ||
| 55 | |||
| 56 | } // namespace kosolapov_v_max_values_in_col_matrix | ||
| 57 |