GCC Code Coverage Report


Directory: ./
File: tasks/shkenev_i_diff_betw_neighb_elem_vec/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 0 20 0.0%
Functions: 0 5 0.0%
Branches: 0 10 0.0%

Line Branch Exec Source
1 #include "shkenev_i_diff_betw_neighb_elem_vec/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <cmath>
5 #include <cstdlib>
6 #include <vector>
7
8 #include "shkenev_i_diff_betw_neighb_elem_vec/common/include/common.hpp"
9
10 namespace shkenev_i_diff_betw_neighb_elem_vec {
11
12 ShkenevIDiffBetwNeighbElemVecSEQ::ShkenevIDiffBetwNeighbElemVecSEQ(const InType &in) {
13 SetTypeOfTask(GetStaticTypeOfTask());
14 GetInput() = in;
15 GetOutput() = 0;
16 }
17
18 bool ShkenevIDiffBetwNeighbElemVecSEQ::ValidationImpl() {
19 return true;
20 }
21
22 bool ShkenevIDiffBetwNeighbElemVecSEQ::PreProcessingImpl() {
23 return true;
24 }
25
26 bool ShkenevIDiffBetwNeighbElemVecSEQ::RunImpl() {
27 const std::vector<int> &vec = GetInput();
28 std::size_t n = vec.size();
29 if (n < 2) {
30 GetOutput() = 0;
31 return true;
32 }
33
34 int max_diff = 0;
35 for (std::size_t i = 0; i < n - 1; i++) {
36 int diff = std::abs(vec[i + 1] - vec[i]);
37 max_diff = std::max(diff, max_diff);
38 }
39
40 GetOutput() = max_diff;
41 return true;
42 }
43
44 bool ShkenevIDiffBetwNeighbElemVecSEQ::PostProcessingImpl() {
45 return true;
46 }
47
48 } // namespace shkenev_i_diff_betw_neighb_elem_vec
49