fpmas 1.6
Public Member Functions | List of all members
fpmas::model::PointHash Struct Reference

#include <grid.h>

Public Member Functions

std::size_t operator() (const DiscretePoint &p) const
 

Detailed Description

DiscretePoint hash function, inspired from boost::hash_combine.

Member Function Documentation

◆ operator()()

std::size_t fpmas::model::PointHash::operator() ( const DiscretePoint p) const

Computes an hash value for p using the following method:

std::size_t hash = std::hash<DiscreteCoordinate>()(p.x);
hash ^= std::hash<DiscreteCoordinate>()(p.y) + 0x9e3779b9
+ (hash << 6) + (hash >> 2);

This comes directly from the boost::hash_combine method.

Parameters
pdiscrete point to hash
Returns
hash value for p

The documentation for this struct was generated from the following files: