| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "zenin_a_sum_values_by_columns_matrix/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cmath> | ||
| 4 | #include <cstddef> | ||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "zenin_a_sum_values_by_columns_matrix/common/include/common.hpp" | ||
| 8 | |||
| 9 | namespace zenin_a_sum_values_by_columns_matrix { | ||
| 10 | |||
| 11 |
1/2✓ Branch 1 taken 120 times.
✗ Branch 2 not taken.
|
120 | ZeninASumValuesByColumnsMatrixSEQ::ZeninASumValuesByColumnsMatrixSEQ(const InType &in) { |
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 | GetInput() = in; | ||
| 14 | 120 | GetOutput() = OutType{}; | |
| 15 | 120 | } | |
| 16 | |||
| 17 | 120 | bool ZeninASumValuesByColumnsMatrixSEQ::ValidationImpl() { | |
| 18 | auto &input = GetInput(); | ||
| 19 |
2/4✓ Branch 0 taken 120 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 120 times.
|
120 | return (std::get<0>(input) * std::get<1>(input)) == std::get<2>(input).size() && (GetOutput().empty()); |
| 20 | } | ||
| 21 | |||
| 22 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 120 times.
|
120 | bool ZeninASumValuesByColumnsMatrixSEQ::PreProcessingImpl() { |
| 23 | auto &input = GetInput(); | ||
| 24 | GetOutput().clear(); | ||
| 25 | 120 | GetOutput().resize(std::get<1>(input), 0.0); | |
| 26 | 120 | return true; | |
| 27 | } | ||
| 28 | |||
| 29 | 120 | bool ZeninASumValuesByColumnsMatrixSEQ::RunImpl() { | |
| 30 | auto &input = GetInput(); | ||
| 31 | auto &rows = std::get<0>(input); | ||
| 32 | auto &columns = std::get<1>(input); | ||
| 33 | auto &matrix = std::get<2>(input); | ||
| 34 |
2/2✓ Branch 0 taken 93152 times.
✓ Branch 1 taken 120 times.
|
93272 | for (size_t row = 0; row < rows; ++row) { |
| 35 |
2/2✓ Branch 0 taken 8495896 times.
✓ Branch 1 taken 93152 times.
|
8589048 | for (size_t col = 0; col < columns; ++col) { |
| 36 | 8495896 | GetOutput()[col] += matrix[(row * columns) + col]; | |
| 37 | } | ||
| 38 | } | ||
| 39 | 120 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | 120 | bool ZeninASumValuesByColumnsMatrixSEQ::PostProcessingImpl() { | |
| 43 | 120 | return true; | |
| 44 | } | ||
| 45 | |||
| 46 | } // namespace zenin_a_sum_values_by_columns_matrix | ||
| 47 |