@@ -31,18 +31,23 @@ TEST(ClusteringTest, Clusters3D) {
3131 std::vector<Benchmark> Points (6 );
3232
3333 // 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 , {})};
3840 // 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 , {})};
4347 // 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 , {})};
4651 // Error cluster: points {2}
4752 Points[2 ].Error = " oops" ;
4853
@@ -70,9 +75,11 @@ TEST(ClusteringTest, Clusters3D) {
7075
7176TEST (ClusteringTest, Clusters3D_InvalidSize) {
7277 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 , {})};
7683 auto Error =
7784 BenchmarkClustering::create (
7885 Points, BenchmarkClustering::ModeE::Dbscan, 2 , 0.25 )
@@ -83,8 +90,10 @@ TEST(ClusteringTest, Clusters3D_InvalidSize) {
8390
8491TEST (ClusteringTest, Clusters3D_InvalidOrder) {
8592 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 , {})};
8897 auto Error =
8998 BenchmarkClustering::create (
9099 Points, BenchmarkClustering::ModeE::Dbscan, 2 , 0.25 )
@@ -110,9 +119,9 @@ TEST(ClusteringTest, Ordering) {
110119TEST (ClusteringTest, Ordering1) {
111120 std::vector<Benchmark> Points (3 );
112121
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 , {}) };
116125
117126 auto Clustering = BenchmarkClustering::create (
118127 Points, BenchmarkClustering::ModeE::Dbscan, 2 , 1.1 );
@@ -124,9 +133,9 @@ TEST(ClusteringTest, Ordering1) {
124133TEST (ClusteringTest, Ordering2) {
125134 std::vector<Benchmark> Points (3 );
126135
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 , {}) };
130139
131140 auto Clustering = BenchmarkClustering::create (
132141 Points, BenchmarkClustering::ModeE::Dbscan, 2 , 1.1 );
0 commit comments