From 001d8f2f909fb59f84ba4d370887dc98b077ccae Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 26 Feb 2008 13:54:02 +0100 Subject: [PATCH] Bernoulli_sum_evalue: make sure no empty partitions are created --- bernoulli.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bernoulli.c b/bernoulli.c index d51cab9..1293a2f 100644 --- a/bernoulli.c +++ b/bernoulli.c @@ -344,6 +344,7 @@ static void Bernoulli_cb(Matrix *M, Value *lower, Value *upper, void *cb_data) */ bound_constraint(M2->p[0]+1, T->Dimension, lower+1, -1, -1, 0); D = AddConstraints(M2->p_Init, 1, T, data->MaxRays); + POL_ENSURE_VERTICES(D); if (emptyQ2(D)) Polyhedron_Free(D); else { @@ -365,6 +366,7 @@ static void Bernoulli_cb(Matrix *M, Value *lower, Value *upper, void *cb_data) */ bound_constraint(M2->p[0]+1, T->Dimension, upper+1, -1, 1, 0); D = AddConstraints(M2->p_Init, 1, T, data->MaxRays); + POL_ENSURE_VERTICES(D); if (emptyQ2(D)) Polyhedron_Free(D); else { @@ -388,6 +390,7 @@ static void Bernoulli_cb(Matrix *M, Value *lower, Value *upper, void *cb_data) bound_constraint(M2->p[0]+1, T->Dimension, upper+1, 1, 0, 0); bound_constraint(M2->p[1]+1, T->Dimension, lower+1, 1, 0, 0); D = AddConstraints(M2->p_Init, 2, T, data->MaxRays); + POL_ENSURE_VERTICES(D); if (emptyQ2(D)) Polyhedron_Free(D); else { @@ -411,6 +414,7 @@ static void Bernoulli_cb(Matrix *M, Value *lower, Value *upper, void *cb_data) bound_constraint(M2->p[0]+1, T->Dimension, lower+1, 1, 1, 1); bound_constraint(M2->p[1]+1, T->Dimension, lower+1, -1, 0, 1); D = AddConstraints(M2->p_Init, 2, T, data->MaxRays); + POL_ENSURE_VERTICES(D); if (emptyQ2(D)) Polyhedron_Free(D); else { @@ -431,6 +435,7 @@ static void Bernoulli_cb(Matrix *M, Value *lower, Value *upper, void *cb_data) bound_constraint(M2->p[0]+1, T->Dimension, upper+1, 1, -1, 1); bound_constraint(M2->p[1]+1, T->Dimension, upper+1, -1, 0, 1); D = AddConstraints(M2->p_Init, 2, T, data->MaxRays); + POL_ENSURE_VERTICES(D); if (emptyQ2(D)) Polyhedron_Free(D); else { -- 2.11.4.GIT