47 namespace hash_tuple {
49 template <
typename TT>
51 size_t operator()(TT
const& tt)
const {
return std::hash<TT>()(tt); }
57 inline void hash_combine(
std::size_t& seed, T
const& v) {
61 template <class Tuple, size_t Index = std::tuple_size<Tuple>::value - 1>
62 struct HashValueImpl {
63 static void apply(
size_t& seed, Tuple
const& tuple) {
64 HashValueImpl<Tuple, Index - 1>::apply(seed, tuple);
65 hash_combine(seed, std::get<Index>(tuple));
69 template <
class Tuple>
70 struct HashValueImpl<Tuple, 0> {
71 static void apply(
size_t& seed, Tuple
const& tuple) {
72 hash_combine(seed, std::get<0>(tuple));
78 template <
typename... TT>
82 HashValueImpl<std::tuple<TT...>>::apply(seed, tt);
89 namespace hash_eigen {
95 for (
int i = 0; i < (
int)matrix.size(); i++) {
96 auto elem = *(matrix.data() + i);
97 seed ^= std::hash<typename T::Scalar>()(elem) + 0x9e3779b9 +
98 (seed << 6) + (seed >> 2);
106 namespace hash_enum_class {
111 template <
typename T>
122 const std::string& str,
123 const std::string& delimiters =
" ",
124 bool trim_empty_str =
true);
131 const std::string& valid_chars =
"_");
134 const std::string& chars =
"\t\n\v\f\r ");
137 const std::string& chars =
"\t\n\v\f\r ");
142 const std::string& chars =
"\t\n\v\f\r ");
145 std::string
ToLower(
const std::string& s);
147 void Sleep(
int milliseconds);
151 div_t tmp = std::div(x, y);
152 return tmp.quot + (tmp.rem != 0 ? 1 : 0);
173 template <
typename T>
175 double p = std::pow(2, power);
177 return static_cast<T
>(1. / p * n);
T UniformRandFloatBinaryFriendly(unsigned int power=5)
Definition: Helper.h:174
int UniformRandInt(const int min, const int max)
Definition: Helper.cpp:109
int DivUp(int x, int y)
Computes the quotient of x/y with rounding up.
Definition: Helper.h:150
Definition: RendererHandle.h:165
size_t operator()(std::tuple< TT... > const &tt) const
Definition: Helper.h:80
size_t WordLength(const std::string &doc, size_t start_pos, const std::string &valid_chars)
Definition: Helper.cpp:80
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c int
Definition: K4aPlugin.cpp:475
Definition: Open3DViewer.h:29
std::string & RightStripString(std::string &str, const std::string &chars)
Definition: Helper.cpp:63
std::size_t operator()(T const &matrix) const
Definition: Helper.h:93
void SplitString(std::vector< std::string > &tokens, const std::string &str, const std::string &delimiters, bool trim_empty_str)
Definition: Helper.cpp:43
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t int32_t int32_t int32_t k4a_color_control_mode_t default_mode value const const k4a_calibration_t calibration char size_t
Definition: K4aPlugin.cpp:720
std::string & StripString(std::string &str, const std::string &chars)
Definition: Helper.cpp:68
void Sleep(int milliseconds)
Definition: Helper.cpp:101
std::size_t operator()(T t) const
Definition: Helper.h:112
size_t operator()(TT const &tt) const
Definition: Helper.h:51
std::string ToLower(const std::string &str)
Convet string to the lower case.
Definition: Helper.cpp:72
std::string & LeftStripString(std::string &str, const std::string &chars)
Definition: Helper.cpp:58