DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
KhalimskyCellHashFunctions.h
1
16
17
#pragma once
18
28
29
#if defined(KhalimskyCellHashFunctions_RECURSES)
30
#error Recursive header files inclusion detected in KhalimskyCellHashFunctions.h
31
#else
// defined(KhalimskyCellHashFunctions_RECURSES)
33
#define KhalimskyCellHashFunctions_RECURSES
34
35
#if !defined KhalimskyCellHashFunctions_h
37
#define KhalimskyCellHashFunctions_h
38
40
// Inclusions
41
#include <iostream>
42
#include "DGtal/base/Common.h"
43
#include "DGtal/topology/KhalimskySpaceND.h"
44
#include <boost/functional/hash.hpp>
46
47
48
namespace
std
{
54
template
<
DGtal::Dimension
dim
,
55
typename
TInteger >
56
struct
hash<
DGtal
::KhalimskyCell< dim, TInteger > >
57
{
58
size_t
operator()
(
const
DGtal::KhalimskyCell< dim, TInteger >
& pp)
const
59
{
60
auto
const
& p = pp.
preCell
();
61
return
boost::hash_range(p.coordinates.begin(), p.coordinates.end());
62
}
63
};
64
70
template
<
DGtal::Dimension
dim
,
71
typename
TInteger >
72
struct
hash<
DGtal
::SignedKhalimskyCell< dim, TInteger > >
73
{
74
size_t
operator()
(
const
DGtal::SignedKhalimskyCell< dim, TInteger >
& pp)
const
75
{
76
auto
const
& p = pp.
preCell
();
77
return
p.
positive
78
? boost::hash_range(p.coordinates.begin(), p.coordinates.end())
79
: boost::hash_range(p.coordinates.begin(), p.coordinates.end()) ^ ( (size_t) 0x7a0d3fe9 );
80
}
81
};
82
83
}
84
85
namespace
boost
{
91
template
<
DGtal::Dimension
dim
,
92
typename
TInteger >
93
struct
hash<
DGtal
::KhalimskyCell< dim, TInteger > >
94
{
95
size_t
operator()
(
const
DGtal::KhalimskyCell< dim, TInteger >
& pp)
const
96
{
97
auto
const
& p = pp.
preCell
();
98
return
boost::hash_range(p.coordinates.begin(), p.coordinates.end());
99
}
100
};
101
107
template
<
DGtal::Dimension
dim
,
108
typename
TInteger >
109
struct
hash<
DGtal
::SignedKhalimskyCell< dim, TInteger > >
110
{
111
size_t
operator()
(
const
DGtal::SignedKhalimskyCell< dim, TInteger >
& pp)
const
112
{
113
auto
const
& p = pp.
preCell
();
114
return
p.
positive
115
? boost::hash_range(p.coordinates.begin(), p.coordinates.end())
116
: boost::hash_range(p.coordinates.begin(), p.coordinates.end()) ^ ( (size_t) 0x7a0d3fe9 );
117
}
118
};
119
120
}
121
122
123
124
#endif
// !defined KhalimskyCellHashFunctions_h
125
126
#undef KhalimskyCellHashFunctions_RECURSES
127
#endif
// else defined(KhalimskyCellHashFunctions_RECURSES)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::Dimension
DGtal::uint32_t Dimension
Definition
Common.h:119
boost
Definition
Boost.dox:28
std
STL namespace.
DGtal::KhalimskyCell
Represents an (unsigned) cell in a cellular grid space by its Khalimsky coordinates.
Definition
KhalimskySpaceND.h:83
DGtal::KhalimskyCell::preCell
PreCell const & preCell() const
Returns the underlying constant pre-cell.
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition
KhalimskySpaceND.h:209
DGtal::SignedKhalimskyCell::preCell
SPreCell const & preCell() const
Returns the underlying constant signed pre-cell.
DGtal::SignedKhalimskyPreCell::positive
bool positive
Cell sign.
Definition
KhalimskyPreSpaceND.h:188
boost::hash< DGtal::KhalimskyCell< dim, TInteger > >::operator()
size_t operator()(const DGtal::KhalimskyCell< dim, TInteger > &pp) const
Definition
KhalimskyCellHashFunctions.h:95
boost::hash< DGtal::SignedKhalimskyCell< dim, TInteger > >::operator()
size_t operator()(const DGtal::SignedKhalimskyCell< dim, TInteger > &pp) const
Definition
KhalimskyCellHashFunctions.h:111
std::hash< DGtal::KhalimskyCell< dim, TInteger > >::operator()
size_t operator()(const DGtal::KhalimskyCell< dim, TInteger > &pp) const
Definition
KhalimskyCellHashFunctions.h:58
std::hash< DGtal::SignedKhalimskyCell< dim, TInteger > >::operator()
size_t operator()(const DGtal::SignedKhalimskyCell< dim, TInteger > &pp) const
Definition
KhalimskyCellHashFunctions.h:74
dim
#define dim
Definition
testImageContainerByHashTree.cpp:40
src
DGtal
topology
KhalimskyCellHashFunctions.h
Generated on
for DGtal by
1.18.0