38 #ifndef HPP_FCL_BROADPHASE_SIMPLEHASHTABLE_INL_H
39 #define HPP_FCL_BROADPHASE_SIMPLEHASHTABLE_INL_H
50 template <
typename Key,
typename Data,
typename HashFnc>
56 template <
typename Key,
typename Data,
typename HashFnc>
68 template <
typename Key,
typename Data,
typename HashFnc>
70 std::vector<unsigned int> indices = h_(key);
71 size_t range = table_.size();
72 for (
size_t i = 0; i < indices.size(); ++i)
73 table_[indices[i] % range].push_back(
value);
77 template <
typename Key,
typename Data,
typename HashFnc>
79 size_t range = table_.size();
80 std::vector<unsigned int> indices = h_(key);
81 std::set<Data> result;
82 for (
size_t i = 0; i < indices.size(); ++i) {
83 size_t index = indices[i] % range;
84 std::copy(table_[
index].begin(), table_[
index].end(),
85 std::inserter(result, result.end()));
88 return std::vector<Data>(result.begin(), result.end());
92 template <
typename Key,
typename Data,
typename HashFnc>
94 size_t range = table_.size();
95 std::vector<unsigned int> indices = h_(key);
96 for (
size_t i = 0; i < indices.size(); ++i) {
97 size_t index = indices[i] % range;
103 template <
typename Key,
typename Data,
typename HashFnc>
106 table_.resize(table_size_);