12 #include <unordered_map>
27 std::unordered_map<Indices, Cell, std::hash<Indices>,
IndicesEqual> map;
37 template <
bool FindAll>
40 template <
typename TFunctor>
41 void iterate(
const TFunctor& func)
const {
52 for (
Size i = 0; i < map.bucket_count(); ++i) {
53 if (map.bucket_size(i) > 15) {
55 "Inefficient hash map: Bucket ", i,
" has ", map.bucket_size(i),
" elements");
63 for (
Size i = 0; i < map.bucket_count(); ++i) {
Object representing a three-dimensional axis-aligned box.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Computing minimum, maximum and mean value of floats.
#define NAMESPACE_SPH_END
const SuccessTag SUCCESS
Global constant for successful outcome.
INLINE Outcome makeFailed(TArgs &&... args)
Constructs failed object with error message.
BasicVector< Float > Vector
Object providing safe access to continuous memory of data.
Helper object defining three-dimensional interval (box).
Helper template, allowing to define all three functions with a single function.
virtual void buildImpl(IScheduler &scheduler, ArrayView< const Vector > points) override
Builds finder from set of vectors.
MinMaxMean getBucketStats() const
HashMapFinder(const RunSettings &settings, const Float cellMult=1._f)
Size find(const Vector &pos, const Size index, const Float radius, Array< NeighbourRecord > &neighs) const
void iterate(const TFunctor &func) const
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Helper object for storing three (possibly four) int or bool values.
Helper class for statistics, accumulating minimal, maximal and mean value of a set of numbers.
INLINE void accumulate(const Float value)
Generic storage and input/output routines of settings.