Skip to content

Commit 95adf40

Browse files
committed
Merge remote-tracking branch 'origin/v9-minor'
2 parents 74311cb + 110b6c6 commit 95adf40

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Fixed bugs
131131
- fix bug in separator aggregation that caused incorrect terminations when for an integral objective the objective limit was set to a fractional value
132132
- fix bug in memory management of doublelex matrices where indices were set beyond array bounds
133133
- store relevance flags in consdataTightenCoefs() of cons_linear.c to avoid dropping variables unintentionally due to numerical changes
134-
- fix possible segmentation fault when resetting original variable bounds after abnormal termination
134+
- fix possible segmentation fault when resetting local and global bounds of original variables after abnormal termination
135135

136136
Performance improvements
137137
------------------------

src/scip/cons_nonlinear.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,6 +3909,30 @@ SCIP_RETCODE reformulateFactorizedBinaryQuadratic(
39093909
SCIP_CALL( SCIPcreateVarBasic(scip, &auxvar, name, minact, maxact, 0.0, integral ? SCIP_VARTYPE_IMPLINT : SCIP_VARTYPE_CONTINUOUS) );
39103910
SCIP_CALL( SCIPaddVar(scip, auxvar) );
39113911

3912+
#ifdef WITH_DEBUG_SOLUTION
3913+
if( SCIPdebugIsMainscip(scip) )
3914+
{
3915+
SCIP_Real debugsolval; /* value of auxvar in debug solution */
3916+
SCIP_Real val;
3917+
3918+
/* compute value of new variable in debug solution */
3919+
/* first \sum_j c_{ij} x_j (coefs[j] * vars[j]) */
3920+
debugsolval = 0.0;
3921+
for( i = 0; i < nvars; ++i )
3922+
{
3923+
SCIP_CALL( SCIPdebugGetSolVal(scip, vars[i], &val) );
3924+
debugsolval += coefs[i] * val;
3925+
}
3926+
3927+
/* now multiply by x_i (facvar) */
3928+
SCIP_CALL( SCIPdebugGetSolVal(scip, facvar, &val) );
3929+
debugsolval *= val;
3930+
3931+
/* store debug solution value of auxiliary variable */
3932+
SCIP_CALL( SCIPdebugAddSolVal(scip, auxvar, debugsolval) );
3933+
}
3934+
#endif
3935+
39123936
/* create and add z - maxact x <= 0 */
39133937
if( !SCIPisZero(scip, maxact) )
39143938
{
@@ -4213,6 +4237,25 @@ SCIP_RETCODE getBinaryProductExprDo(
42134237
SCIP_CALL( SCIPaddVar(scip, w) );
42144238
SCIPdebugMsg(scip, " created auxiliary variable %s\n", name);
42154239

4240+
#ifdef WITH_DEBUG_SOLUTION
4241+
if( SCIPdebugIsMainscip(scip) )
4242+
{
4243+
SCIP_Real debugsolval; /* value of auxvar in debug solution */
4244+
SCIP_Real val;
4245+
4246+
/* compute value of new variable in debug solution (\prod_i vars[i]) */
4247+
debugsolval = 1.0;
4248+
for( i = 0; i < nchildren; ++i )
4249+
{
4250+
SCIP_CALL( SCIPdebugGetSolVal(scip, vars[i], &val) );
4251+
debugsolval *= val;
4252+
}
4253+
4254+
/* store debug solution value of auxiliary variable */
4255+
SCIP_CALL( SCIPdebugAddSolVal(scip, w, debugsolval) );
4256+
}
4257+
#endif
4258+
42164259
/* use variable bound constraints if it is a bilinear product and there is no empathy for an AND constraint */
42174260
if( nchildren == 2 && !empathy4and )
42184261
{

0 commit comments

Comments
 (0)