|
9 | 9 | #include "mcmtest.h" |
10 | 10 | #include "testing.h" |
11 | 11 | #include <random> |
| 12 | +#include <type_traits> |
12 | 13 |
|
13 | 14 |
|
14 | 15 | using namespace MaxPlus; |
@@ -216,7 +217,7 @@ void MCMTest::test_yto() { |
216 | 217 | ASSERT_THROW(eid == 6); |
217 | 218 |
|
218 | 219 | // TODO: check of the cycle ratio are identical to old SDF3 |
219 | | - CDouble expectedMinCycleRatios[] = { |
| 220 | + std::array<CDouble,250> expectedMinCycleRatios = { |
220 | 221 | 0.526141, 0.124523, 0.0389826, 0.289127, 0.11451, 0.723313, 1.07027, |
221 | 222 | 0.956067, 0.570066, 0.746341, 0.33622, 0.475978, 0.902663, 1.02951, |
222 | 223 | 0.088711, 0.269878, 0.213763, 0.468927, 2.13632, 0.564086, 0.656227, |
@@ -262,12 +263,12 @@ void MCMTest::test_yto() { |
262 | 263 | //std::cout << "MCM: " << result << "cycle length: " << cycle->size() << std::endl; |
263 | 264 | } |
264 | 265 |
|
265 | | - CDouble expectedMaxCycleRatios[] = { |
| 266 | + std::array<CDouble, 25> expectedMaxCycleRatios = { |
266 | 267 | 304.647, 122.759, 104.209, 126.85, 1341.83, 135.611, 186.801, 151.854, 341.077, |
267 | 268 | 216.21, 148.74, 117.382, 127.863, 246.385, 92.0357, 72.9353, 124.893, 202.074, |
268 | 269 | 281.92, 481.408, 253.295, 849.381, 123.668, 64.0955, 219.92}; |
269 | 270 | // go through a bunch of (deterministic) big pseudo-random graphs |
270 | | - for (int k = 0; k < 25; k++) { |
| 271 | + for (int k = 0; k < expectedMaxCycleRatios.size(); k++) { |
271 | 272 | MCMgraph gr = makeRandomGraph(1000, 100000, k); |
272 | 273 | result = maxCycleRatioAndCriticalCycleYoungTarjanOrlin(gr, &cycle); |
273 | 274 | ASSERT_APPROX_EQUAL(expectedMaxCycleRatios[k], result, 1e-2); |
|
0 commit comments