2014-11-28 06:13:18 -05:00
|
|
|
#ifndef HILBERT_VALUE_HPP
|
|
|
|
#define HILBERT_VALUE_HPP
|
2013-06-26 09:43:13 -04:00
|
|
|
|
2014-05-07 08:47:23 -04:00
|
|
|
#include <cstdint>
|
2013-06-26 09:43:13 -04:00
|
|
|
|
2016-01-05 10:51:13 -05:00
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace util
|
|
|
|
{
|
|
|
|
|
2013-06-26 09:43:13 -04:00
|
|
|
// computes a 64 bit value that corresponds to the hilbert space filling curve
|
|
|
|
|
2014-05-07 08:47:23 -04:00
|
|
|
struct FixedPointCoordinate;
|
|
|
|
|
|
|
|
class HilbertCode
|
2014-03-17 10:12:13 -04:00
|
|
|
{
|
2014-05-07 08:47:23 -04:00
|
|
|
public:
|
|
|
|
uint64_t operator()(const FixedPointCoordinate ¤t_coordinate) const;
|
|
|
|
HilbertCode() {}
|
|
|
|
HilbertCode(const HilbertCode &) = delete;
|
|
|
|
|
|
|
|
private:
|
2014-10-21 12:34:50 -04:00
|
|
|
inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const;
|
|
|
|
inline void TransposeCoordinate(uint32_t *X) const;
|
2013-06-26 09:43:13 -04:00
|
|
|
};
|
|
|
|
|
2016-01-05 10:51:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif /* HILBERT_VALUE_HPP */
|