std::size_t operator()(const SurfaceVertex& v) const { using boost::hash_value; using boost::hash_combine; // Start with a hash value of 0 . std::size_t seed = 0; // Modify 'seed' by XORing and bit-shifting in // one member of 'Key' after the other: hash_combine(seed,hash_value(v.position[0])); hash_combine(seed,hash_value(v.position[1])); hash_combine(seed,hash_value(v.position[2])); // Return the result. return seed; }
locator::locator(const std::string &filename, const map_location &loc, int center_x, int center_y, const std::string& modifications) : val_(filename, loc, center_x, center_y, modifications) { hash_ = hash_value(val_); hash1_ = hash_value1(val_); }
locator::locator(const std::string &filename) : val_(filename) { parse_arguments(); hash_ = hash_value(val_); hash1_ = hash_value1(val_); }
locator::locator(const char *filename) : val_(filename) { parse_arguments(); hash_ = hash_value(val_); hash1_ = hash_value1(val_); }
std::size_t operator()(const Edge<Z>& edge) const { using boost::hash_value; using boost::hash_combine; static std::hash<Z> observationHasher; std::size_t seed = 0; hash_combine(seed,hash_value(edge.actionIndex)); hash_combine(seed,observationHasher(edge.observation)); return seed; }
locator::locator(const locator &a, const std::string& mods): val_(a.val_) { if (mods.size()){ val_.modifications_ += mods; val_.type_=SUB_FILE; } hash_ = hash_value(val_); hash1_ = hash_value1(val_); }
size_t hash_value(const locator::value& val) { using boost::hash_value; using boost::hash_combine; size_t hash = hash_value(val.type_); if (val.type_ == locator::FILE || val.type_ == locator::SUB_FILE) { hash_combine(hash, val.filename_); } if (val.type_ == locator::SUB_FILE) { hash_combine(hash, val.loc_.x); hash_combine(hash, val.loc_.y); hash_combine(hash, val.center_x_); hash_combine(hash, val.center_y_); hash_combine(hash, val.modifications_); } return hash; }
inline size_t hash_value (SubID const& sID) { return hash_value (string (sID)); }
std::size_t operator()(const T& value) const { using boost::hash_value; return hash_value(value); }
std::size_t operator()(const T& x) const { return hash_value(x); }
locator::locator(const std::string &filename, const std::string& modifications) : val_(filename, modifications) { hash_ = hash_value(val_); hash1_ = hash_value1(val_); }
locator::locator() : val_() { hash_ = hash_value(val_); hash1_ = hash_value1(val_); }