|
template<bool throwIfIndexOutOfBounds = false> |
std::vector< Value > & | getNeighborListRef (size_t index) |
| Getter for a reference to a neighbor list by index.
|
|
template<bool throwIfKeyIsUnknown = false> |
std::vector< Value > & | getNeighborListRef (const Key &key) |
| Getter for a reference to a neighbor list by key.
|
|
size_t | getNewNeighborList () |
| Reserves a neighbor list for use.
|
|
size_t | getNewNeighborList (const Key &key) |
| Assigns a neighbor list to the given key.
|
|
void | clear () |
| Clears the internal key map and moves _lastValidListIndex to indicate an empty buffer.
|
|
void | reserveNeighborLists (size_t n) |
| Resize the internal buffer so that there are new spare lists.
|
|
void | setDefaultListLength (size_t defaultListLength) |
| Set the initial length of new neighbor lists.
|
|
void | setGrowthFactor (double growthFactor) |
| Set the growth factor for the internal buffer.
|
|
template<class Key, class Value, class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
class autopas::NeighborListsBuffer< Key, Value, Hash, KeyEqual >
Class for manual memory management of neighbor lists.
The key, value system behaves similar to a std::unordered_map, so see the official doc regarding these details.
A internal buffer of lists is kept in memory, never deleted, and only its content cleared and reassigned. Get access to new lists via the index returned from getNewNeighborList() and work on them via getNeighborListRef().
- Template Parameters
-
Key | Preferably something that is cheap to destroy. |
Value | Has to be default constructable. |
Hash | |
KeyEqual | |