| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "safronov_m_sum_values_matrix/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "safronov_m_sum_values_matrix/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace safronov_m_sum_values_matrix { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
80 | SafronovMSumValuesMatrixSEQ::SafronovMSumValuesMatrixSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 |
1/2✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
80 | InType tmp(in); |
| 13 | GetInput().swap(tmp); | ||
| 14 | 80 | } | |
| 15 | |||
| 16 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 8 times.
|
80 | bool SafronovMSumValuesMatrixSEQ::ValidationImpl() { |
| 17 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 8 times.
|
80 | if (GetInput().empty()) { |
| 18 | return true; | ||
| 19 | } | ||
| 20 | size_t cols = GetInput()[0].size(); | ||
| 21 | std::size_t total = 0; | ||
| 22 |
2/2✓ Branch 0 taken 1008 times.
✓ Branch 1 taken 72 times.
|
1080 | for (const auto &row : GetInput()) { |
| 23 | 1008 | total += row.size(); | |
| 24 | } | ||
| 25 |
3/6✓ Branch 0 taken 72 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 72 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
|
72 | return GetOutput().empty() && (cols != 0) && ((cols * GetInput().size()) == total); |
| 26 | } | ||
| 27 | |||
| 28 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 80 times.
|
80 | bool SafronovMSumValuesMatrixSEQ::PreProcessingImpl() { |
| 29 | GetOutput().clear(); | ||
| 30 | 80 | return true; | |
| 31 | } | ||
| 32 | |||
| 33 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 8 times.
|
80 | bool SafronovMSumValuesMatrixSEQ::RunImpl() { |
| 34 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 8 times.
|
80 | if (GetInput().empty()) { |
| 35 | return true; | ||
| 36 | } | ||
| 37 | 72 | std::vector<double> vector(GetInput()[0].size()); | |
| 38 |
2/2✓ Branch 0 taken 1048 times.
✓ Branch 1 taken 72 times.
|
1120 | for (size_t i = 0; i < GetInput()[0].size(); i++) { |
| 39 | double summa = 0; | ||
| 40 |
2/2✓ Branch 0 taken 80824 times.
✓ Branch 1 taken 1048 times.
|
81872 | for (const auto &row : GetInput()) { |
| 41 | 80824 | summa += row[i]; | |
| 42 | } | ||
| 43 | 1048 | vector[i] = summa; | |
| 44 | } | ||
| 45 |
1/2✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
|
72 | GetOutput() = vector; |
| 46 | return true; | ||
| 47 | } | ||
| 48 | |||
| 49 | 80 | bool SafronovMSumValuesMatrixSEQ::PostProcessingImpl() { | |
| 50 | 80 | return true; | |
| 51 | } | ||
| 52 | |||
| 53 | } // namespace safronov_m_sum_values_matrix | ||
| 54 |