@@ -31,18 +31,23 @@ TEST(ClusteringTest, Clusters3D) {
31
31
std::vector<Benchmark> Points (6 );
32
32
33
33
// Cluster around (x=0, y=1, z=2): points {0, 3}.
34
- Points[0 ].Measurements = {
35
- {" x" , 0.01 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
36
- Points[3 ].Measurements = {
37
- {" x" , -0.01 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
34
+ Points[0 ].Measurements = {BenchmarkMeasure::Create (" x" , 0.01 , {}),
35
+ BenchmarkMeasure::Create (" y" , 1.02 , {}),
36
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
37
+ Points[3 ].Measurements = {BenchmarkMeasure::Create (" x" , -0.01 , {}),
38
+ BenchmarkMeasure::Create (" y" , 1.02 , {}),
39
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
38
40
// Cluster around (x=1, y=1, z=2): points {1, 4}.
39
- Points[1 ].Measurements = {
40
- {" x" , 1.01 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
41
- Points[4 ].Measurements = {
42
- {" x" , 0.99 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
41
+ Points[1 ].Measurements = {BenchmarkMeasure::Create (" x" , 1.01 , {}),
42
+ BenchmarkMeasure::Create (" y" , 1.02 , {}),
43
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
44
+ Points[4 ].Measurements = {BenchmarkMeasure::Create (" x" , 0.99 , {}),
45
+ BenchmarkMeasure::Create (" y" , 1.02 , {}),
46
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
43
47
// Cluster around (x=0, y=0, z=0): points {5}, marked as noise.
44
- Points[5 ].Measurements = {
45
- {" x" , 0.0 , 0.0 , {}}, {" y" , 0.01 , 0.0 , {}}, {" z" , -0.02 , 0.0 , {}}};
48
+ Points[5 ].Measurements = {BenchmarkMeasure::Create (" x" , 0.0 , {}),
49
+ BenchmarkMeasure::Create (" y" , 0.01 , {}),
50
+ BenchmarkMeasure::Create (" z" , -0.02 , {})};
46
51
// Error cluster: points {2}
47
52
Points[2 ].Error = " oops" ;
48
53
@@ -70,9 +75,11 @@ TEST(ClusteringTest, Clusters3D) {
70
75
71
76
TEST (ClusteringTest, Clusters3D_InvalidSize) {
72
77
std::vector<Benchmark> Points (6 );
73
- Points[0 ].Measurements = {
74
- {" x" , 0.01 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
75
- Points[1 ].Measurements = {{" y" , 1.02 , 0.0 , {}}, {" z" , 1.98 , 0.0 , {}}};
78
+ Points[0 ].Measurements = {BenchmarkMeasure::Create (" x" , 0.01 , {}),
79
+ BenchmarkMeasure::Create (" y" , 1.02 , {}),
80
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
81
+ Points[1 ].Measurements = {BenchmarkMeasure::Create (" y" , 1.02 , {}),
82
+ BenchmarkMeasure::Create (" z" , 1.98 , {})};
76
83
auto Error =
77
84
BenchmarkClustering::create (
78
85
Points, BenchmarkClustering::ModeE::Dbscan, 2 , 0.25 )
@@ -83,8 +90,10 @@ TEST(ClusteringTest, Clusters3D_InvalidSize) {
83
90
84
91
TEST (ClusteringTest, Clusters3D_InvalidOrder) {
85
92
std::vector<Benchmark> Points (6 );
86
- Points[0 ].Measurements = {{" x" , 0.01 , 0.0 , {}}, {" y" , 1.02 , 0.0 , {}}};
87
- Points[1 ].Measurements = {{" y" , 1.02 , 0.0 , {}}, {" x" , 1.98 , 0.0 , {}}};
93
+ Points[0 ].Measurements = {BenchmarkMeasure::Create (" x" , 0.01 , {}),
94
+ BenchmarkMeasure::Create (" y" , 1.02 , {})};
95
+ Points[1 ].Measurements = {BenchmarkMeasure::Create (" y" , 1.02 , {}),
96
+ BenchmarkMeasure::Create (" x" , 1.98 , {})};
88
97
auto Error =
89
98
BenchmarkClustering::create (
90
99
Points, BenchmarkClustering::ModeE::Dbscan, 2 , 0.25 )
@@ -110,9 +119,9 @@ TEST(ClusteringTest, Ordering) {
110
119
TEST (ClusteringTest, Ordering1) {
111
120
std::vector<Benchmark> Points (3 );
112
121
113
- Points[0 ].Measurements = {{ " x" , 0.0 , 0.0 , {}} };
114
- Points[1 ].Measurements = {{ " x" , 1.0 , 0.0 , {}} };
115
- Points[2 ].Measurements = {{ " x" , 2.0 , 0.0 , {}} };
122
+ Points[0 ].Measurements = {BenchmarkMeasure::Create ( " x" , 0.0 , {}) };
123
+ Points[1 ].Measurements = {BenchmarkMeasure::Create ( " x" , 1.0 , {}) };
124
+ Points[2 ].Measurements = {BenchmarkMeasure::Create ( " x" , 2.0 , {}) };
116
125
117
126
auto Clustering = BenchmarkClustering::create (
118
127
Points, BenchmarkClustering::ModeE::Dbscan, 2 , 1.1 );
@@ -124,9 +133,9 @@ TEST(ClusteringTest, Ordering1) {
124
133
TEST (ClusteringTest, Ordering2) {
125
134
std::vector<Benchmark> Points (3 );
126
135
127
- Points[0 ].Measurements = {{ " x" , 0.0 , 0.0 , {}} };
128
- Points[1 ].Measurements = {{ " x" , 2.0 , 0.0 , {}} };
129
- Points[2 ].Measurements = {{ " x" , 1.0 , 0.0 , {}} };
136
+ Points[0 ].Measurements = {BenchmarkMeasure::Create ( " x" , 0.0 , {}) };
137
+ Points[1 ].Measurements = {BenchmarkMeasure::Create ( " x" , 2.0 , {}) };
138
+ Points[2 ].Measurements = {BenchmarkMeasure::Create ( " x" , 1.0 , {}) };
130
139
131
140
auto Clustering = BenchmarkClustering::create (
132
141
Points, BenchmarkClustering::ModeE::Dbscan, 2 , 1.1 );
0 commit comments