OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
standard.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_UTILITIES_STANDARD_HPP
2 #define OPENPOSE_UTILITIES_STANDARD_HPP
3
4 #include <openpose/core/common.hpp>
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
common.hpp
op::error
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
op::mergeVectors
std::vector< T > mergeVectors(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:40
op::vectorsAreEqual
bool vectorsAreEqual(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:9