OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{HashTable.cpp}::perfect_hash Namespace Reference

Functions

void to_set_one_to_one (const int32_t *const ptr4, size_t entry_count, DecodedJoinHashBufferSet &s)
 
void to_set_one_to_many (const int32_t *const ptr2, const int32_t *const ptr3, const int32_t *const ptr4, size_t entry_count, DecodedJoinHashBufferSet &s)
 

Function Documentation

void anonymous_namespace{HashTable.cpp}::perfect_hash::to_set_one_to_many ( const int32_t *const  ptr2,
const int32_t *const  ptr3,
const int32_t *const  ptr4,
size_t  entry_count,
DecodedJoinHashBufferSet s 
)

Definition at line 43 of file HashTable.cpp.

References DecodedJoinHashBufferEntry::key, and DecodedJoinHashBufferEntry::payload.

Referenced by HashTable::toSet().

47  {
48  auto empty = -1;
49  auto ptr = ptr2;
50  for (size_t e = 0; e < entry_count; ++e, ++ptr) {
51  if (*ptr == empty) {
52  continue;
53  }
54 
55  decltype(DecodedJoinHashBufferEntry::key) key;
56  key.push_back(e);
57 
58  int32_t offset = ptr2[e];
59 
60  int32_t count = ptr3[e];
61 
62  decltype(DecodedJoinHashBufferEntry::payload) payload;
63  for (size_t j = 0; j < static_cast<size_t>(count); ++j) {
64  payload.insert(ptr4[offset + j]);
65  }
66 
67  s.insert({std::move(key), std::move(payload)});
68  }
69 }
Definition: HashTable.h:21
std::vector< int64_t > key
Definition: HashTable.h:22

+ Here is the caller graph for this function:

void anonymous_namespace{HashTable.cpp}::perfect_hash::to_set_one_to_one ( const int32_t *const  ptr4,
size_t  entry_count,
DecodedJoinHashBufferSet s 
)

Definition at line 23 of file HashTable.cpp.

References DecodedJoinHashBufferEntry::key, and DecodedJoinHashBufferEntry::payload.

Referenced by HashTable::toSet().

25  {
26  const auto empty = -1;
27  auto ptr = ptr4;
28  for (size_t e = 0; e < entry_count; ++e, ++ptr) {
29  if (*ptr == empty) {
30  continue;
31  }
32 
33  decltype(DecodedJoinHashBufferEntry::key) key;
34  key.push_back(e);
35 
36  decltype(DecodedJoinHashBufferEntry::payload) payload;
37  payload.insert(*ptr);
38 
39  s.insert({std::move(key), std::move(payload)});
40  }
41 }
Definition: HashTable.h:21
std::vector< int64_t > key
Definition: HashTable.h:22

+ Here is the caller graph for this function: