|
|
|
@ -411,6 +411,42 @@ TEST(InfinityTest, generate_cut_test_4)
|
|
|
|
|
lhs = CG_replace_x(&cut, x);
|
|
|
|
|
EXPECT_LE(lhs, cut.pi_zero);
|
|
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
|
if (rval) FAIL();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(InfinityTest, generate_cut_test_5)
|
|
|
|
|
{
|
|
|
|
|
int rval = 0;
|
|
|
|
|
|
|
|
|
|
// Extracted from instance bell5.pre.mps (MIPLIB 3)
|
|
|
|
|
char column_types[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, };
|
|
|
|
|
double pi0[] = { 1.0000000000, 0.0416666667, -0.0416666667, -0.0416666667, };
|
|
|
|
|
double pi1[] = { 1.0000000000, 0.0416666667, -0.0416666667, -0.0416666667, -0.0416666667, };
|
|
|
|
|
int indices0[] = { 50, 64, 143, 156, };
|
|
|
|
|
int indices1[] = { 49, 63, 64, 142, 155, };
|
|
|
|
|
struct Row row0 = {.nz = 4, .head = 50, .pi_zero = 41.6666666667, .pi = pi0, .indices = indices0 };
|
|
|
|
|
struct Row row1 = {.nz = 5, .head = 49, .pi_zero = 16.6666666667, .pi = pi1, .indices = indices1 };
|
|
|
|
|
struct Row* rows[] = {&row0, &row1, };
|
|
|
|
|
struct Tableau tableau = {.ncols = 169, .nrows = 2, .rows = rows, .column_types = column_types };
|
|
|
|
|
double x[169] = {1.0000000000, 1.0000000000, 1.0000000000, 1.0000000000, 1.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 1.0000000000, 0.0000000000, 11.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 2.0000000000, 38.0000000000, 2.0000000000, 498.0000000000, 125.0000000000, 10.0000000000, 17.0000000000, 41.0000000000, 0.0000000000, 19.0000000000, 0.0000000000, 8318.0000000000, 7494.0000000000, 60.0000000000, 10.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 18.0000000000, 8.0000000000, 16.0000000000, 334.0000000000, 24.0000000000, 792.0000000000, 792.0000000000, 336.0000000000, 336.0000000000, 0.0000000000, 40.0000000000, 166.0000000000, 3000.0000000000, 1632.0000000000, 1392.0000000000, 984.0000000000, 456.0000000000, 456.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 48.0000000000, 900.0000000000, 40.0000000000, 11950.0000000000, 240.0000000000, 408.0000000000, 984.0000000000, 0.0000000000, 456.0000000000, 0.0000000000, -0.0000000000, -0.0000000000, -0.0000000000, -0.0000000000, 1.0000000000, 0.0000000000, 1.0000000000, 1.0000000000, 0.0000000000, 1.0000000000, 1.0000000000, 20.0000000000, 20.0000000000, 20.0000000000, 19.0000000000, 19.0000000000, 0.0000000000, 9.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 20.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 238.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 12.0000000000, 8.0000000000, 2.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0053700000, 0.6917620000, 6.9221320000, 0.0000000000, 0.9966800000, 11.9862220000, 0.7510000000, 0.8495500000, 3.3519300000, 266583.5900000000, };
|
|
|
|
|
|
|
|
|
|
double lhs, s[2];
|
|
|
|
|
struct Row cut;
|
|
|
|
|
LP_init_row(&cut, CG_total_nz(&tableau));
|
|
|
|
|
|
|
|
|
|
rval = INFINITY_generate_cut(&tableau, &cut);
|
|
|
|
|
abort_if(rval, "INFINITY_generate_cut failed");
|
|
|
|
|
|
|
|
|
|
rval = get_lattice_point(&tableau, x, s);
|
|
|
|
|
abort_if(rval, "get_lattice_point failed");
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < tableau.nrows; i++)
|
|
|
|
|
log_debug("s[%d] = %20.12lf\n", i, s[i]);
|
|
|
|
|
|
|
|
|
|
lhs = CG_replace_x(&cut, x);
|
|
|
|
|
EXPECT_LE(lhs, cut.pi_zero);
|
|
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
|
if (rval) FAIL();
|
|
|
|
|
}
|