| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "spichek_d_dot_product_of_vectors/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | |||
| 5 | #include "spichek_d_dot_product_of_vectors/common/include/common.hpp" | ||
| 6 | |||
| 7 | namespace spichek_d_dot_product_of_vectors { | ||
| 8 | |||
| 9 |
1/2✓ Branch 1 taken 142 times.
✗ Branch 2 not taken.
|
142 | SpichekDDotProductOfVectorsSEQ::SpichekDDotProductOfVectorsSEQ(const InType &in) { |
| 10 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 11 | GetInput() = in; | ||
| 12 | 142 | GetOutput() = 0; | |
| 13 | 142 | } | |
| 14 | |||
| 15 | 142 | bool SpichekDDotProductOfVectorsSEQ::ValidationImpl() { | |
| 16 | const auto &[vector1, vector2] = GetInput(); | ||
| 17 | 142 | return vector1.size() == vector2.size(); | |
| 18 | } | ||
| 19 | |||
| 20 | 142 | bool SpichekDDotProductOfVectorsSEQ::PreProcessingImpl() { | |
| 21 | 142 | GetOutput() = 0; | |
| 22 | 142 | return true; | |
| 23 | } | ||
| 24 | |||
| 25 |
2/2✓ Branch 0 taken 134 times.
✓ Branch 1 taken 8 times.
|
142 | bool SpichekDDotProductOfVectorsSEQ::RunImpl() { |
| 26 | const auto &[vector1, vector2] = GetInput(); | ||
| 27 | |||
| 28 |
3/4✓ Branch 0 taken 134 times.
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
|
142 | if (vector1.empty() && vector2.empty()) { |
| 29 | 8 | GetOutput() = 0; | |
| 30 | 8 | return true; | |
| 31 | } | ||
| 32 | |||
| 33 | int dot_product = 0; | ||
| 34 |
2/2✓ Branch 0 taken 52322 times.
✓ Branch 1 taken 134 times.
|
52456 | for (size_t i = 0; i < vector1.size(); ++i) { |
| 35 | 52322 | dot_product += vector1[i] * vector2[i]; | |
| 36 | } | ||
| 37 | |||
| 38 | 134 | GetOutput() = dot_product; | |
| 39 | 134 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | 142 | bool SpichekDDotProductOfVectorsSEQ::PostProcessingImpl() { | |
| 43 | 142 | return true; | |
| 44 | } | ||
| 45 | |||
| 46 | } // namespace spichek_d_dot_product_of_vectors | ||
| 47 |