| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "vlasova_a_elem_matrix_sum/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "vlasova_a_elem_matrix_sum/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace vlasova_a_elem_matrix_sum { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
|
24 | VlasovaAElemMatrixSumSEQ::VlasovaAElemMatrixSumSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 | GetInput() = in; | ||
| 13 | GetOutput() = {}; | ||
| 14 | 24 | } | |
| 15 | |||
| 16 | 24 | bool VlasovaAElemMatrixSumSEQ::ValidationImpl() { | |
| 17 | 24 | int rows = std::get<1>(GetInput()); | |
| 18 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | int cols = std::get<2>(GetInput()); |
| 19 | const auto &matrix_data = std::get<0>(GetInput()); | ||
| 20 | |||
| 21 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | return matrix_data.size() == static_cast<size_t>(rows) * static_cast<size_t>(cols) && rows > 0 && cols > 0; |
| 22 | } | ||
| 23 | |||
| 24 | 24 | bool VlasovaAElemMatrixSumSEQ::PreProcessingImpl() { | |
| 25 | 24 | int rows = std::get<1>(GetInput()); | |
| 26 | 24 | GetOutput().resize(rows, 0); | |
| 27 | 24 | return true; | |
| 28 | } | ||
| 29 | |||
| 30 | 24 | bool VlasovaAElemMatrixSumSEQ::RunImpl() { | |
| 31 | 24 | int rows = std::get<1>(GetInput()); | |
| 32 | 24 | int cols = std::get<2>(GetInput()); | |
| 33 | const auto &matrix_data = std::get<0>(GetInput()); | ||
| 34 | |||
| 35 |
2/2✓ Branch 0 taken 376 times.
✓ Branch 1 taken 24 times.
|
400 | for (int i = 0; i < rows; ++i) { |
| 36 | int row_sum = 0; | ||
| 37 |
2/2✓ Branch 0 taken 10760 times.
✓ Branch 1 taken 376 times.
|
11136 | for (int j = 0; j < cols; ++j) { |
| 38 | 10760 | row_sum += matrix_data[(i * cols) + j]; | |
| 39 | } | ||
| 40 | 376 | GetOutput()[i] = row_sum; | |
| 41 | } | ||
| 42 | 24 | return true; | |
| 43 | } | ||
| 44 | |||
| 45 | 24 | bool VlasovaAElemMatrixSumSEQ::PostProcessingImpl() { | |
| 46 | 24 | return true; | |
| 47 | } | ||
| 48 | |||
| 49 | } // namespace vlasova_a_elem_matrix_sum | ||
| 50 |