Add calculation of close-tangibles

This commit is contained in:
2021-08-09 12:54:32 -04:00
parent 3fa782383e
commit fb6bd8d163
6 changed files with 50 additions and 10 deletions

View File

@@ -28,7 +28,6 @@ std::string id_vector_debug_string(const IdVector &idv) {
return oss.str();
}
IdVector sort_union_id_vectors(const IdVector &v1, const IdVector &v2) {
IdVector result(v1.size() + v2.size());
int next = 0;
@@ -47,6 +46,13 @@ IdVector sort_union_id_vectors(const IdVector &v1, const IdVector &v2) {
return result;
}
HashValue hash_id_vector(const IdVector &idv) {
uint64_t hash1 = 0;
uint64_t hash2 = 0;
SpookyHash::Hash128(&idv[0], idv.size() * sizeof(int64_t), &hash1, &hash2);
return std::make_pair(hash1, hash2);
}
StringVec split(const std::string &s, char sep) {
StringVec result;
int start = 0;