DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testPointHashFunctions.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "ConfigTest.h"
34
#include "DGtal/helpers/StdDefs.h"
35
36
#include "DGtalCatch.h"
37
38
#include "DGtal/kernel/PointVector.h"
39
#include "DGtal/helpers/StdDefs.h"
40
#include "DGtal/kernel/PointHashFunctions.h"
42
43
using namespace
std
;
44
using namespace
DGtal
;
45
46
47
48
TEST_CASE
(
"Hash functions on DGtal::Point"
)
49
{
50
Z3i::Point
p(0,0,0);
51
Z3i::Point
q(10,0,0);
52
Z3i::Point
p_copy(0,0,0);
53
std::hash<Z3i::Point> myhashcpp11;
54
55
SECTION
(
"Identity test"
)
56
{
57
REQUIRE
( myhashcpp11(p) == myhashcpp11(p_copy) );
58
}
59
60
61
SECTION
(
"Difference test"
)
62
{
63
REQUIRE
( myhashcpp11(p) != myhashcpp11(q) );
64
}
65
66
SECTION
(
"Higher dimension identity test"
)
67
{
68
typedef
PointVector<26,int>
Point26;
69
Point26 pp=Point26::diagonal(12),
70
qq=(Point26::diagonal(11) + Point26::diagonal(1)),
71
rr=Point26::diagonal(13);
72
73
std::hash<Point26> myhash26cpp11;
74
75
REQUIRE
( myhash26cpp11(pp) == myhash26cpp11(qq) );
76
REQUIRE
( myhash26cpp11(pp) != myhash26cpp11(rr) );
77
}
78
}
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition
PointVector.h:593
DGtal::Z3i::Point
Space::Point Point
Definition
StdDefs.h:168
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
std
STL namespace.
TEST_CASE
TEST_CASE("int container traits", "[int][traits]")
Definition
testContainerTraits.cpp:53
SECTION
SECTION("Testing constant forward iterators")
Definition
testSimpleRandomAccessRangeFromPoint.cpp:66
REQUIRE
REQUIRE(domain.isInside(aPoint))
tests
kernel
testPointHashFunctions.cpp
Generated on
for DGtal by
1.18.0