| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "luzan_e_matrix_rows_sum/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <tuple> | ||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "luzan_e_matrix_rows_sum/common/include/common.hpp" | ||
| 8 | |||
| 9 | namespace luzan_e_matrix_rows_sum { | ||
| 10 | |||
| 11 |
1/2✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
|
72 | LuzanEMatrixRowsSumSEQ::LuzanEMatrixRowsSumSEQ(const InType &in) { |
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 | GetInput() = in; | ||
| 14 | GetOutput() = {}; | ||
| 15 | 72 | } | |
| 16 | |||
| 17 | 72 | bool LuzanEMatrixRowsSumSEQ::ValidationImpl() { | |
| 18 | 72 | int height = std::get<1>(GetInput()); | |
| 19 |
1/2✓ Branch 0 taken 72 times.
✗ Branch 1 not taken.
|
72 | int width = std::get<2>(GetInput()); |
| 20 | |||
| 21 |
1/2✓ Branch 0 taken 72 times.
✗ Branch 1 not taken.
|
72 | return std::get<0>(GetInput()).size() == static_cast<size_t>(height) * static_cast<size_t>(width) && height > 0 && |
| 22 | 72 | width > 0; | |
| 23 | } | ||
| 24 | |||
| 25 | 72 | bool LuzanEMatrixRowsSumSEQ::PreProcessingImpl() { | |
| 26 | 72 | int height = std::get<1>(GetInput()); | |
| 27 | 72 | GetOutput().resize(height); | |
| 28 |
2/2✓ Branch 0 taken 24976 times.
✓ Branch 1 taken 72 times.
|
25048 | for (int row = 0; row < height; row++) { |
| 29 | 24976 | GetOutput()[row] = 0; | |
| 30 | } | ||
| 31 | 72 | return true; | |
| 32 | } | ||
| 33 | |||
| 34 | 72 | bool LuzanEMatrixRowsSumSEQ::RunImpl() { | |
| 35 | 72 | int height = std::get<1>(GetInput()); | |
| 36 | 72 | int width = std::get<2>(GetInput()); | |
| 37 | const std::tuple_element_t<0, InType> &mat = std::get<0>(GetInput()); | ||
| 38 | |||
| 39 |
2/2✓ Branch 0 taken 24976 times.
✓ Branch 1 taken 72 times.
|
25048 | for (int row = 0; row < height; row++) { |
| 40 |
2/2✓ Branch 0 taken 8167360 times.
✓ Branch 1 taken 24976 times.
|
8192336 | for (int col = 0; col < width; col++) { |
| 41 | 8167360 | GetOutput()[row] += mat[(width * row) + col]; | |
| 42 | } | ||
| 43 | } | ||
| 44 | 72 | return true; | |
| 45 | } | ||
| 46 | |||
| 47 | 72 | bool LuzanEMatrixRowsSumSEQ::PostProcessingImpl() { | |
| 48 | 72 | return true; | |
| 49 | } | ||
| 50 | |||
| 51 | } // namespace luzan_e_matrix_rows_sum | ||
| 52 |