Fix bug in QP_solver and add respective test cases. The bug was that the artificial variable was not correctly expelled at the end of phase one in certain cases of redundant constraints.

(This is with permission of Laurent Rineau)
This commit is contained in:
Yves Brise 2012-02-02 22:43:24 +00:00
parent dc3059da99
commit 6eaf901af2
4 changed files with 138 additions and 6 deletions

2
.gitattributes vendored
View File

@ -3446,6 +3446,8 @@ QP_solver/test/QP_solver/test_default_bounds.cpp -text
QP_solver/test/QP_solver/test_random_qp.cpp -text
QP_solver/test/QP_solver/test_random_qp2.cpp -text
QP_solver/test/QP_solver/test_solver.cout -text
QP_solver/test/QP_solver/test_solver_data/cycle_cases/bug_stich.mps -text
QP_solver/test/QP_solver/test_solver_data/cycle_cases/bug_taysom.mps -text
QP_solver/test/QP_solver/test_solver_data/cycle_cases/helbling_001.mps -text
QP_solver/test/QP_solver/test_solver_data/cycle_cases/helbling_248.mps -text
QP_solver/test/QP_solver/test_solver_data/cycle_cases/helbling_39.mps -text

View File

@ -1255,12 +1255,7 @@ expel_artificial_variables_from_basis( )
// explicitly are synchronized during transition from phaseI to phaseII
for (unsigned int i_ = static_cast<unsigned int>(qp_n + slack_A.size()); i_ < static_cast<unsigned int>(in_B.size()); ++i_) {
if (is_basic(i_)) { // is basic
if (has_ineq) {
row_ind = in_C[ art_A[i_ - qp_n - slack_A.size()].first];
} else {
row_ind = art_A[i_ - qp_n].first;
}
row_ind = in_B[i_];
//CGAL_qpe_assertion(row_ind >= 0);

View File

@ -0,0 +1,105 @@
* Description: Case that was sent in by Sebastian Stich. It used to exibit
* a segfault in expel_artificial_variables (special artificial is linked to a
* constraint that is not active).
* Derivatives: none
NAME MY_MPS
ROWS
N obj
G c0
G c1
E c2
G c3
G c4
G c5
G c6
G c7
G c8
E c9
G c10
G c11
G c12
E c13
G c14
G c15
E c16
G c17
G c18
G c19
E c20
COLUMNS
x0 c0 1
x0 c1 1
x0 c2 1
x0 c3 1
x0 c4 1
x1 c5 1
x1 c6 1
x1 c7 1
x1 c8 1
x1 c9 1
x1 c10 1
x1 c11 1
x2 c0 1
x2 c5 1
x2 c12 1
x2 c13 1
x3 c1 1
x3 c6 1
x3 c12 1
x3 c14 1
x3 c15 1
x3 c16 1
x4 c7 1
x4 c13 1
x4 c17 1
x4 c18 1
x4 c19 1
x5 c2 1
x6 c3 1
x6 c8 1
x6 c14 1
x6 c17 1
x6 c20 1
x7 c9 1
x8 c4 1
x8 c10 1
x8 c15 1
x8 c18 1
x8 c20 1
x9 c11 1
x9 c16 1
x9 c19 1
RHS
rhs c0 1
rhs c1 1
rhs c2 1
rhs c3 1
rhs c4 1
rhs c5 1
rhs c6 1
rhs c7 1
rhs c8 1
rhs c9 1
rhs c10 1
rhs c11 1
rhs c12 1
rhs c13 1
rhs c14 1
rhs c15 1
rhs c16 1
rhs c17 1
rhs c18 1
rhs c19 1
rhs c20 1
BOUNDS
UP BND x0 1
UP BND x1 1
UP BND x2 1
UP BND x3 1
UP BND x4 1
UP BND x5 1
UP BND x6 1
UP BND x7 1
UP BND x8 1
UP BND x9 1
ENDATA

View File

@ -0,0 +1,30 @@
* Description: Case that was sent in by William Taysom. It used to exibit
* a segfault in expel_artificial_variables (special artificial is linked to a
* constraint that is not active).
NAME MY_MPS
ROWS
N obj
E c0
G c1
G c2
G c3
COLUMNS
x0 obj 1
x0 c0 1
x0 c1 1
x0 c2 1
x0 c3 1
x1 c0 1
x1 c1 1
x1 c3 1
x2 c0 1
x2 c1 1
x2 c2 1
RHS
rhs c0 4
rhs c1 4
rhs c2 3
rhs c3 3
BOUNDS
UP BND x0 2
ENDATA