Skip to content

Commit 884ec7f

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 2a4dc74 + 028296b commit 884ec7f

File tree

3 files changed

+12
-36
lines changed

3 files changed

+12
-36
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Fixed bugs
7575
- handle exact solutions in SCIPsolCheckOrig(), SCIPcheckSolOrig(), and SCIPrecomputeSolObj() to correctly check exact initial solutions in SCIPtransformProb()
7676
- fixed use of interactive option (-i) of AMPL interface
7777
- fix calculation of Euclidean norm in calcEfficacyDenseStorage() for use in exact solving
78+
- fixed bug with changing the type of the slack variable in indicator constraints while copying
7879

7980
Miscellaneous
8081
-------------

check/testset/exact.test

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
instances/MIPEX/egout.zpl
1+
instances/MIPEX/egout.cip
22
instances/MIP/enigma.mps
33
instances/MIPEX/flugpl_rational.mps
4-
instances/MIPEX/misc03.zpl
4+
instances/MIPEX/misc03p1.zpl
55
instances/MIPEX/rgn.zpl
6-
instances/MIPEX/stein27.zpl
7-
instances/MIP/stein27_inf.lp
86
instances/MIP/Side.lp
7+
instances/MIPEX/Side-coef.cip
98
instances/MIPEX/Side-coeftest.lp
9+
instances/MIPEX/stein27.zpl
10+
instances/MIP/stein27_inf.lp
1011
instances/PseudoBoolean/normalized-t2001.13queen13.1111218308.opb

src/scip/cons_indicator.c

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8234,7 +8234,7 @@ SCIP_RETCODE SCIPcreateConsBasicIndicator(
82348234
}
82358235

82368236
/** creates and captures an indicator constraint with given linear constraint and slack variable
8237-
* in a generic version, i. e., with a flag activeone indicating whether the constraint is active on
8237+
* in a generic version, i.e., with a flag activeone indicating whether the constraint is active on
82388238
* value 1 or 0 of the binary variable.
82398239
82408240
* @note @a binvar is checked to be binary only later. This enables a change of the type in
@@ -8280,10 +8280,8 @@ SCIP_RETCODE SCIPcreateConsIndicatorGenericLinCons(
82808280
SCIP_CONSHDLRDATA* conshdlrdata;
82818281
SCIP_CONSDATA* consdata = NULL;
82828282
SCIP_VAR** vars;
8283-
SCIP_Real* vals;
82848283
SCIP_Bool modifiable = FALSE;
82858284
SCIP_Bool linconsactive;
8286-
SCIP_Bool integral = TRUE;
82878285
int nvars;
82888286
int v;
82898287

@@ -8317,45 +8315,21 @@ SCIP_RETCODE SCIPcreateConsIndicatorGenericLinCons(
83178315
return SCIP_INVALIDDATA;
83188316
}
83198317

8320-
/* determine integrality of slack variable and whether problem is decomposed if no variables are integral */
8318+
/* determine whether the linear constraint needs to be active */
83218319
nvars = SCIPgetNVarsLinear(scip, lincons);
83228320
vars = SCIPgetVarsLinear(scip, lincons);
8323-
vals = SCIPgetValsLinear(scip, lincons);
8324-
linconsactive = !conshdlrdata->nolinconscont;
8325-
for ( v = 0; v < nvars; ++v )
8321+
linconsactive = ! conshdlrdata->nolinconscont;
8322+
for ( v = 0; v < nvars && ! linconsactive; ++v )
83268323
{
83278324
if ( vars[v] == slackvar )
83288325
continue;
83298326

83308327
if ( SCIPvarIsIntegral(vars[v]) )
8331-
{
83328328
linconsactive = TRUE;
8333-
if ( !integral )
8334-
break;
8335-
if ( !SCIPisIntegral(scip, vals[v]) )
8336-
{
8337-
integral = FALSE;
8338-
break;
8339-
}
8340-
}
8341-
else
8342-
{
8343-
integral = FALSE;
8344-
if ( linconsactive )
8345-
break;
8346-
}
83478329
}
83488330

8349-
/* make sure that the type of the slack is as general as necessary */
8350-
if ( !integral && SCIPvarIsIntegral(slackvar) )
8351-
{
8352-
SCIP_Bool infeasible;
8353-
8354-
SCIP_CALL( SCIPchgVarType(scip, slackvar, SCIP_VARTYPE_CONTINUOUS, &infeasible) );
8355-
assert( !infeasible );
8356-
SCIP_CALL( SCIPchgVarImplType(scip, slackvar, SCIP_IMPLINTTYPE_NONE, &infeasible) );
8357-
assert( !infeasible );
8358-
}
8331+
/* Note that we do not change the type of the slackvariable here, because it might appear in other constraints and
8332+
* the locks are note yet set up if we are copying. */
83598333

83608334
/* mark slack variable not to be multi-aggregated */
83618335
SCIP_CALL( SCIPmarkDoNotMultaggrVar(scip, slackvar) );

0 commit comments

Comments
 (0)