Skip to content

Commit 3c0cebd

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 84099ba + 348c260 commit 3c0cebd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ Fixed bugs
431431
- fixed rare invalid memory access when collecting symmetry information for indicator constraints
432432
- recompute activity bounds before checking infeasibility and redundancy in linear constraint presolving
433433
- skip integer variables with fractional value in reference solution when finding additional variable fixings in ALNS heuristic
434+
- fix call of SCIPaddExprsViolScoreNonlinear() with constant expressions (no variables)
434435

435436
Build system
436437
------------

src/scip/cons_nonlinear.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6331,7 +6331,7 @@ void addExprsViolScore(
63316331
int i;
63326332

63336333
assert(exprs != NULL);
6334-
assert(nexprs > 0);
6334+
assert(nexprs >= 0);
63356335
assert(success != NULL);
63366336

63376337
if( nexprs == 1 )
@@ -6343,6 +6343,12 @@ void addExprsViolScore(
63436343
return;
63446344
}
63456345

6346+
if( nexprs == 0 )
6347+
{
6348+
*success = FALSE;
6349+
return;
6350+
}
6351+
63466352
conshdlr = SCIPexprGetOwnerData(exprs[0])->conshdlr;
63476353

63486354
for( i = 0; i < nexprs; ++i )
@@ -6451,12 +6457,7 @@ SCIP_RETCODE addExprViolScoresAuxVars(
64516457

64526458
SCIPfreeExpriter(&it);
64536459

6454-
if( nexprs > 0 )
6455-
{
6456-
SCIP_CALL( SCIPaddExprsViolScoreNonlinear(scip, exprs, nexprs, violscore, sol, success) );
6457-
}
6458-
else
6459-
*success = FALSE;
6460+
SCIP_CALL( SCIPaddExprsViolScoreNonlinear(scip, exprs, nexprs, violscore, sol, success) );
64606461

64616462
SCIPfreeBufferArray(scip, &exprs);
64626463

0 commit comments

Comments
 (0)