OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
standard.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_UTILITIES_STANDARD_HPP
2 #define OPENPOSE_UTILITIES_STANDARD_HPP
3 
5 
6 namespace op
7 {
8  template <typename T>
9  bool vectorsAreEqual(const std::vector<T>& vectorA, const std::vector<T>& vectorB)
10  {
11  try
12  {
13  if (vectorA.size() != vectorB.size())
14  return false;
15  else
16  {
17  for (auto i = 0u ; i < vectorA.size() ; i++)
18  if (vectorA[i] != vectorB[i])
19  return false;
20  return true;
21  }
22  }
23  catch (const std::exception& e)
24  {
25  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
26  return false;
27  }
28  }
29 
39  template <typename T>
40  std::vector<T> mergeVectors(const std::vector<T>& vectorA, const std::vector<T>& vectorB)
41  {
42  try
43  {
44  auto vectorToReturn(vectorA);
45  for (auto& tElement : vectorB)
46  vectorToReturn.emplace_back(tElement);
47  return vectorToReturn;
48  }
49  catch (const std::exception& e)
50  {
51  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
52  return std::vector<T>{};
53  }
54  }
55 }
56 
57 #endif // OPENPOSE_UTILITIES_STANDARD_HPP
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
std::vector< T > mergeVectors(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:40
bool vectorsAreEqual(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:9