DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
PointHashFunctions.h
1
16
17
#pragma once
18
28
29
#if defined(PointHashFunctions_RECURSES)
30
#error Recursive header files inclusion detected in PointHashFunctions.h
31
#else
// defined(PointHashFunctions_RECURSES)
33
#define PointHashFunctions_RECURSES
34
35
#if !defined PointHashFunctions_h
37
#define PointHashFunctions_h
38
40
// Inclusions
41
#include <iostream>
42
#include "DGtal/base/Common.h"
43
#include "DGtal/kernel/PointVector.h"
44
#include "DGtal/kernel/NumberTraits.h"
45
#include "DGtal/base/BasicTypes.h"
46
#include <functional>
47
#include <boost/functional/hash.hpp>
49
50
56
57
namespace
std
{
58
template
<
DGtal::Dimension
dim
,
59
typename
EuclideanRing,
60
typename
Container>
61
struct
hash<
DGtal
::PointVector<dim,EuclideanRing,Container> >
62
{
63
size_t
operator()
(
const
DGtal::PointVector<dim,EuclideanRing,Container>
& p)
const
64
{
65
return
boost::hash_range(p.
begin
(), p.
end
());
66
}
67
};
68
}
69
70
namespace
std
71
{
72
template
<>
73
struct
hash<
DGtal
::BigInteger >
74
{
75
size_t
operator()
(
const
DGtal::BigInteger
& p)
const
76
{
77
return
DGtal::NumberTraits<DGtal::BigInteger>::castToInt64_t
( p );
78
}
79
};
80
}
81
//Also defining boost::hash since boost::hash_range needs it.
82
namespace
boost
83
{
84
template
<>
85
struct
hash<
DGtal
::BigInteger > : std::hash<DGtal::BigInteger>
86
{ };
87
}
88
89
90
91
#endif
// !defined PointHashFunctions_h
92
93
#undef PointHashFunctions_RECURSES
94
#endif
// else defined(PointHashFunctions_RECURSES)
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition
PointVector.h:593
DGtal::PointVector::begin
Iterator begin()
DGtal::PointVector::end
Iterator end()
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
DGtal::BigInteger
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>, boost::multiprecision::et_off > BigInteger
Definition
BasicTypes.h:75
boost
Definition
Boost.dox:28
std
STL namespace.
DGtal::NumberTraitsImpl< std::decay< T >::type >::castToInt64_t
static DGtal::int64_t castToInt64_t(const T &aT)
Definition
NumberTraits.h:145
std::hash< DGtal::BigInteger >::operator()
size_t operator()(const DGtal::BigInteger &p) const
Definition
PointHashFunctions.h:75
std::hash< DGtal::PointVector< dim, EuclideanRing, Container > >::operator()
size_t operator()(const DGtal::PointVector< dim, EuclideanRing, Container > &p) const
Definition
PointHashFunctions.h:63
dim
#define dim
Definition
testImageContainerByHashTree.cpp:40
src
DGtal
kernel
PointHashFunctions.h
Generated on
for DGtal by
1.18.0