9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
22 std::vector<double> temperatures{64., 16., 4., 2., 1.5, 1.};
32 double chi2 = config.
cutOff + 3.14;
35 double previousWeight = 1.;
37 std::cout <<
"Check weight decrease:" << std::endl;
38 for (
auto temp : temperatures) {
39 double weight = annealingTool.
getWeight(state, chi2);
41 bool hasDecreased = weight < previousWeight;
43 BOOST_CHECK(hasDecreased);
45 previousWeight = weight;
46 annealingTool.
anneal(state);
48 std::cout <<
"\tTemperature: " << temp <<
", weight: " << weight
64 chi2 = config.
cutOff - 3.14;
69 std::cout <<
"Check weight increase:" << std::endl;
70 for (
auto temp : temperatures) {
71 double weight = annealingTool.
getWeight(state, chi2);
73 bool hasIncreased = weight > previousWeight;
75 BOOST_CHECK(hasIncreased);
77 previousWeight = weight;
78 annealingTool.
anneal(state);
80 std::cout <<
"\tTemperature: " << temp <<
", weight: " << weight
95 std::cout <<
"Check weight insensitivity:" << std::endl;
96 for (
auto temp : temperatures) {
97 double weight = annealingTool.
getWeight(state, chi2);
99 bool hasNotChanged = weight == previousWeight;
101 BOOST_CHECK(hasNotChanged);
103 previousWeight = weight;
104 annealingTool.
anneal(state);
106 std::cout <<
"\tTemperature: " << temp <<
", weight: " << weight
113 std::vector<double> allChi2{1.3, 4.5, 8.4, 0.4, 10.3, 12.3,
114 3.5, 5.8, 11.0, 1.1, 3.5, 6.7};
116 std::vector<double> temperatures{64., 16., 4., 2., 1.5, 1.};
126 double chi2 = config.
cutOff + 5.;
129 double previousWeight = 1.;
131 std::cout <<
"Check weight decrease:" << std::endl;
132 for (
auto temp : temperatures) {
133 double weight = annealingTool.
getWeight(state, chi2, allChi2);
135 bool hasDecreased = weight < previousWeight;
137 BOOST_CHECK(hasDecreased);
139 previousWeight = weight;
140 annealingTool.
anneal(state);
142 std::cout <<
"\tTemperature: " << temp <<
", weight: " << weight
163 std::cout <<
"Check weight increase:" << std::endl;
164 for (
auto temp : temperatures) {
165 double weight = annealingTool.
getWeight(state, chi2, allChi2);
167 bool hasIncreased = weight > previousWeight;
169 BOOST_CHECK(hasIncreased);
171 previousWeight = weight;
172 annealingTool.
anneal(state);
174 std::cout <<
"\tTemperature: " << temp <<
", weight: " << weight