38 #ifndef COAL_BROADPHASE_SIMPLEHASHTABLE_INL_H
39 #define COAL_BROADPHASE_SIMPLEHASHTABLE_INL_H
49 template <
typename Key,
typename Data,
typename HashFnc>
55 template <
typename Key,
typename Data,
typename HashFnc>
67 template <
typename Key,
typename Data,
typename HashFnc>
69 std::vector<unsigned int> indices = h_(key);
70 size_t range = table_.size();
71 for (
size_t i = 0; i < indices.size(); ++i)
72 table_[indices[i] % range].push_back(
value);
76 template <
typename Key,
typename Data,
typename HashFnc>
78 size_t range = table_.size();
79 std::vector<unsigned int> indices = h_(key);
80 std::set<Data> result;
81 for (
size_t i = 0; i < indices.size(); ++i) {
82 size_t index = indices[i] % range;
83 std::copy(table_[
index].begin(), table_[
index].end(),
84 std::inserter(result, result.end()));
87 return std::vector<Data>(result.begin(), result.end());
91 template <
typename Key,
typename Data,
typename HashFnc>
93 size_t range = table_.size();
94 std::vector<unsigned int> indices = h_(key);
95 for (
size_t i = 0; i < indices.size(); ++i) {
96 size_t index = indices[i] % range;
102 template <
typename Key,
typename Data,
typename HashFnc>
105 table_.resize(table_size_);