@@ -75,39 +75,39 @@ void run_tests() {
75
75
// - lower edge of shrink: pick bin which contains edge, lower <= x < upper
76
76
// - upper edge of shrink: pick bin which contains edge + 1, lower < x <= upper
77
77
{
78
- auto h = make (Tag (), ID (0 , 3 ));
78
+ auto h = make (Tag (), ID (0.0 , 3.0 ));
79
79
const auto & ax = h.axis ();
80
- BOOST_TEST_EQ (ax.value (0 ), 0 );
81
- BOOST_TEST_EQ (ax.value (3 ), 3 );
82
- BOOST_TEST_EQ (ax.index (-1 ), -1 );
83
- BOOST_TEST_EQ (ax.index (3 ), 3 );
84
-
85
- BOOST_TEST_EQ (reduce (h, shrink (-1 , 5 )).axis (), ID (0 , 3 ));
86
- BOOST_TEST_EQ (reduce (h, shrink (0 , 3 )).axis (), ID (0 , 3 ));
87
- BOOST_TEST_EQ (reduce (h, shrink (1 , 3 )).axis (), ID (1 , 3 ));
88
- BOOST_TEST_EQ (reduce (h, shrink (1.001 , 3 )).axis (), ID (1 , 3 ));
89
- BOOST_TEST_EQ (reduce (h, shrink (1.999 , 3 )).axis (), ID (1 , 3 ));
90
- BOOST_TEST_EQ (reduce (h, shrink (2 , 3 )).axis (), ID (2 , 3 ));
91
- BOOST_TEST_EQ (reduce (h, shrink (0 , 2.999 )).axis (), ID (0 , 3 ));
92
- BOOST_TEST_EQ (reduce (h, shrink (0 , 2.001 )).axis (), ID (0 , 3 ));
93
- BOOST_TEST_EQ (reduce (h, shrink (0 , 2 )).axis (), ID (0 , 2 ));
94
- BOOST_TEST_EQ (reduce (h, shrink (0 , 1.999 )).axis (), ID (0 , 2 ));
95
-
96
- BOOST_TEST_EQ (reduce (h, crop (-1 , 5 )).axis (), ID (0 , 3 ));
97
- BOOST_TEST_EQ (reduce (h, crop (0 , 3 )).axis (), ID (0 , 3 ));
98
- BOOST_TEST_EQ (reduce (h, crop (1 , 3 )).axis (), ID (1 , 3 ));
99
- BOOST_TEST_EQ (reduce (h, crop (1.001 , 3 )).axis (), ID (1 , 3 ));
100
- BOOST_TEST_EQ (reduce (h, crop (1.999 , 3 )).axis (), ID (1 , 3 ));
101
- BOOST_TEST_EQ (reduce (h, crop (2 , 3 )).axis (), ID (2 , 3 ));
102
- BOOST_TEST_EQ (reduce (h, crop (0 , 2.999 )).axis (), ID (0 , 3 ));
103
- BOOST_TEST_EQ (reduce (h, crop (0 , 2.001 )).axis (), ID (0 , 3 ));
104
- BOOST_TEST_EQ (reduce (h, crop (0 , 2 )).axis (), ID (0 , 2 ));
105
- BOOST_TEST_EQ (reduce (h, crop (0 , 1.999 )).axis (), ID (0 , 2 ));
80
+ BOOST_TEST_EQ (ax.value (0 ), 0.0 );
81
+ BOOST_TEST_EQ (ax.value (3 ), 3.0 );
82
+ BOOST_TEST_EQ (ax.index (-1.0 ), -1 );
83
+ BOOST_TEST_EQ (ax.index (3.0 ), 3 );
84
+
85
+ BOOST_TEST_EQ (reduce (h, shrink (-1 , 5 )).axis (), ID (0.0 , 3.0 ));
86
+ BOOST_TEST_EQ (reduce (h, shrink (0 , 3 )).axis (), ID (0.0 , 3.0 ));
87
+ BOOST_TEST_EQ (reduce (h, shrink (1 , 3 )).axis (), ID (1.0 , 3.0 ));
88
+ BOOST_TEST_EQ (reduce (h, shrink (1.001 , 3 )).axis (), ID (1.0 , 3.0 ));
89
+ BOOST_TEST_EQ (reduce (h, shrink (1.999 , 3 )).axis (), ID (1.0 , 3.0 ));
90
+ BOOST_TEST_EQ (reduce (h, shrink (2 , 3 )).axis (), ID (2.0 , 3.0 ));
91
+ BOOST_TEST_EQ (reduce (h, shrink (0 , 2.999 )).axis (), ID (0.0 , 3.0 ));
92
+ BOOST_TEST_EQ (reduce (h, shrink (0 , 2.001 )).axis (), ID (0.0 , 3.0 ));
93
+ BOOST_TEST_EQ (reduce (h, shrink (0 , 2 )).axis (), ID (0.0 , 2.0 ));
94
+ BOOST_TEST_EQ (reduce (h, shrink (0 , 1.999 )).axis (), ID (0.0 , 2.0 ));
95
+
96
+ BOOST_TEST_EQ (reduce (h, crop (-1 , 5 )).axis (), ID (0.0 , 3.0 ));
97
+ BOOST_TEST_EQ (reduce (h, crop (0 , 3 )).axis (), ID (0.0 , 3.0 ));
98
+ BOOST_TEST_EQ (reduce (h, crop (1 , 3 )).axis (), ID (1.0 , 3.0 ));
99
+ BOOST_TEST_EQ (reduce (h, crop (1.001 , 3 )).axis (), ID (1.0 , 3.0 ));
100
+ BOOST_TEST_EQ (reduce (h, crop (1.999 , 3 )).axis (), ID (1.0 , 3.0 ));
101
+ BOOST_TEST_EQ (reduce (h, crop (2 , 3 )).axis (), ID (2.0 , 3.0 ));
102
+ BOOST_TEST_EQ (reduce (h, crop (0 , 2.999 )).axis (), ID (0.0 , 3.0 ));
103
+ BOOST_TEST_EQ (reduce (h, crop (0 , 2.001 )).axis (), ID (0.0 , 3.0 ));
104
+ BOOST_TEST_EQ (reduce (h, crop (0 , 2 )).axis (), ID (0.0 , 2.0 ));
105
+ BOOST_TEST_EQ (reduce (h, crop (0 , 1.999 )).axis (), ID (0.0 , 2.0 ));
106
106
}
107
107
108
108
// shrink and rebin
109
109
{
110
- auto h = make_s (Tag (), std::vector<int >(), R (4 , 1 , 5 , " 1" ), R (3 , -1 , 2 , " 2" ));
110
+ auto h = make_s (Tag (), std::vector<int >(), R (4 , 1.0 , 5.0 , " 1" ), R (3 , -1.0 , 2.0 , " 2" ));
111
111
112
112
/*
113
113
matrix layout:
0 commit comments