45 namespace hash_tuple {
47 template <
typename TT>
49 size_t operator()(TT
const& tt)
const {
return std::hash<TT>()(tt); }
55 inline void hash_combine(std::size_t& seed, T
const& v) {
59 template <class Tuple, size_t Index = std::tuple_size<Tuple>::value - 1>
60 struct HashValueImpl {
61 static void apply(
size_t& seed, Tuple
const& tuple) {
62 HashValueImpl<Tuple, Index - 1>::apply(seed, tuple);
63 hash_combine(seed, std::get<Index>(tuple));
67 template <
class Tuple>
68 struct HashValueImpl<Tuple, 0> {
69 static void apply(
size_t& seed, Tuple
const& tuple) {
70 hash_combine(seed, std::get<0>(tuple));
76 template <
typename... TT>
77 struct hash<std::tuple<TT...>> {
80 HashValueImpl<std::tuple<TT...>>::apply(seed, tt);
87 namespace hash_eigen {
90 struct hash : std::unary_function<T, size_t> {
93 for (
int i = 0; i < (int)matrix.size(); i++) {
94 auto elem = *(matrix.data() + i);
95 seed ^= std::hash<typename T::Scalar>()(elem) + 0x9e3779b9 +
96 (seed << 6) + (seed >> 2);
107 const std::string& str,
108 const std::string& delimiters =
" ",
109 bool trim_empty_str =
true);
114 const std::string& white_space =
" \t\n");
121 const std::string& valid_chars =
"_");
size_t operator()(std::tuple< TT... > const &tt) const
Definition: Helper.h:78
size_t WordLength(const std::string &doc, size_t start_pos, const std::string &valid_chars)
Definition: Helper.cpp:60
Definition: PinholeCameraIntrinsic.cpp:34
std::size_t operator()(T const &matrix) const
Definition: Helper.h:91
std::string StripString(const std::string &s, const std::string &white_space)
Definition: Helper.cpp:50
void SplitString(std::vector< std::string > &tokens, const std::string &str, const std::string &delimiters, bool trim_empty_str)
Definition: Helper.cpp:35
size_t operator()(TT const &tt) const
Definition: Helper.h:49