Skip to content
Snippets Groups Projects
Commit d2251e6e authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Add hash function for two doubles (for non-polarized Fresnel)

parent 4810963e
No related branches found
No related tags found
No related merge requests found
......@@ -20,3 +20,8 @@ size_t HashKVector::operator()(kvector_t kvec) const noexcept
{
return m_double_hash(kvec.x()) ^ m_double_hash(kvec.y()) ^ m_double_hash(kvec.z());
}
size_t Hash2Doubles::operator()(std::pair<double, double> doubles) const noexcept
{
return m_double_hash(doubles.first) ^ m_double_hash(doubles.second);
}
......@@ -18,6 +18,7 @@
#include "Vectors3D.h"
#include <functional>
#include <utility>
class HashKVector
{
......@@ -30,4 +31,15 @@ private:
std::hash<double> m_double_hash;
};
class Hash2Doubles
{
public:
Hash2Doubles() {}
~Hash2Doubles() {}
size_t operator()(std::pair<double, double> doubles) const noexcept;
private:
std::hash<double> m_double_hash;
};
#endif // HASHKVECTOR_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment