Skip to content

Commit 2dfffc9

Browse files
committed
Merge remote-tracking branch 'origin/v9-minor'
2 parents a05fc59 + 7b45648 commit 2dfffc9

File tree

12 files changed

+46
-13
lines changed

12 files changed

+46
-13
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ Fixed bugs
343343
- disable objective limit during lexicographic dual minimization to keep feasibility status
344344
- declare infinite bound inference infeasible in SCIPinferVarLbCons() and SCIPinferVarUbCons() to maintain correct loose LP values
345345
- fixed update of consssorted flags in a variable expressions data when adding an additional constraint using this variable
346+
- corrected computation of number of variables affected by symmetry
346347

347348
Build system
348349
------------

applications/Scheduler/src/heur_optcumulative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25-
/**@file heur_optcumulative.h
25+
/**@file heur_optcumulative.c
2626
* @ingroup PRIMALHEURISTICS
2727
* @brief heuristic for cumulative scheduling with optional activities
2828
* @author Stefan Heinz

src/scip/cons_and.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5134,6 +5134,7 @@ SCIP_RETCODE SCIPcreateConsAnd(
51345134
}
51355135

51365136
/* check whether all variables are binary */
5137+
assert(vars != NULL || nvars == 0);
51375138
for( i = 0; i < nvars; ++i )
51385139
{
51395140
if( !SCIPvarIsBinary(vars[i]) )

src/scip/cons_cardinality.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3664,6 +3664,19 @@ SCIP_RETCODE SCIPcreateConsCardinality(
36643664
return SCIP_PLUGINNOTFOUND;
36653665
}
36663666

3667+
/* check whether indicator variables are binary */
3668+
if( indvars != NULL )
3669+
{
3670+
for( v = 0; v < nvars; ++v )
3671+
{
3672+
if( !SCIPvarIsBinary(indvars[v]) )
3673+
{
3674+
SCIPerrorMessage("indicator <%s> is not binary\n", SCIPvarGetName(indvars[v]));
3675+
return SCIP_INVALIDDATA;
3676+
}
3677+
}
3678+
}
3679+
36673680
/* get constraint handler data */
36683681
conshdlrdata = SCIPconshdlrGetData(conshdlr);
36693682
assert(conshdlrdata != NULL);

src/scip/cons_indicator.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,13 +3372,12 @@ SCIP_RETCODE consdataCreate(
33723372
assert( slackvar != NULL );
33733373
assert( eventhdlrrestart != NULL );
33743374

3375-
/* if active on 0, a provided binary variable is reversed */
3375+
/* if active on 0, a provided binary variable is negated */
33763376
if ( activeone || binvar == NULL )
3377-
{
33783377
binvarinternal = binvar;
3379-
}
33803378
else
33813379
{
3380+
assert( SCIPvarIsBinary(binvar) );
33823381
SCIP_CALL( SCIPgetNegatedVar(scip, binvar, &binvarinternal) );
33833382
}
33843383

@@ -8058,11 +8057,12 @@ SCIP_RETCODE SCIPcreateConsIndicatorGeneric(
80588057
}
80598058
}
80608059

8061-
/* if active on 0, a provided binary variable is reversed */
8060+
/* if active on 0, a provided binary variable is negated */
80628061
if ( activeone || binvar == NULL )
80638062
binvarinternal = binvar;
80648063
else
80658064
{
8065+
assert( SCIPvarIsBinary(binvar) );
80668066
SCIP_CALL( SCIPgetNegatedVar(scip, binvar, &binvarinternal) );
80678067
}
80688068

@@ -8385,15 +8385,14 @@ SCIP_RETCODE SCIPcreateConsIndicatorGenericLinCons(
83858385

83868386
SCIP_Real val = 1.0;
83878387

8388-
/* if active on 0, the binary variable is reversed */
8388+
/* if active on 0, the binary variable is negated */
83898389
SCIP_VAR* binvarinternal;
83908390
if ( activeone )
8391-
{
83928391
binvarinternal = binvar;
8393-
}
83948392
else
83958393
{
8396-
SCIP_CALL ( SCIPgetNegatedVar(scip, binvar, &binvarinternal) );
8394+
assert( SCIPvarIsBinary(binvar) );
8395+
SCIP_CALL( SCIPgetNegatedVar(scip, binvar, &binvarinternal) );
83978396
}
83988397

83998398
/* create a quadratic constraint with a single bilinear term - note that cons is used */
@@ -8627,11 +8626,12 @@ SCIP_RETCODE SCIPcreateConsIndicatorGenericLinConsPure(
86278626
}
86288627
}
86298628

8630-
/* if active on 0, the binary variable is reversed */
8629+
/* if active on 0, the binary variable is negated */
86318630
if ( activeone )
86328631
binvarinternal = binvar;
86338632
else
86348633
{
8634+
assert( SCIPvarIsBinary(binvar) );
86358635
SCIP_CALL( SCIPgetNegatedVar(scip, binvar, &binvarinternal) );
86368636
}
86378637

src/scip/cons_knapsack.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13663,6 +13663,7 @@ SCIP_RETCODE SCIPcreateConsKnapsack(
1366313663
SCIP_CONSHDLRDATA* conshdlrdata;
1366413664
SCIP_CONSHDLR* conshdlr;
1366513665
SCIP_CONSDATA* consdata;
13666+
int i;
1366613667

1366713668
/* find the knapsack constraint handler */
1366813669
conshdlr = SCIPfindConshdlr(scip, CONSHDLR_NAME);
@@ -13672,6 +13673,17 @@ SCIP_RETCODE SCIPcreateConsKnapsack(
1367213673
return SCIP_PLUGINNOTFOUND;
1367313674
}
1367413675

13676+
/* check whether all variables are binary */
13677+
assert(vars != NULL || nvars == 0);
13678+
for( i = 0; i < nvars; ++i )
13679+
{
13680+
if( !SCIPvarIsBinary(vars[i]) )
13681+
{
13682+
SCIPerrorMessage("item <%s> is not binary\n", SCIPvarGetName(vars[i]));
13683+
return SCIP_INVALIDDATA;
13684+
}
13685+
}
13686+
1367513687
/* get event handler */
1367613688
conshdlrdata = SCIPconshdlrGetData(conshdlr);
1367713689
assert(conshdlrdata != NULL);

src/scip/cons_logicor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5463,6 +5463,7 @@ SCIP_RETCODE SCIPcreateConsLogicor(
54635463
}
54645464

54655465
/* check whether all variables are binary */
5466+
assert(vars != NULL || nvars == 0);
54665467
for( i = 0; i < nvars; ++i )
54675468
{
54685469
if( !SCIPvarIsBinary(vars[i]) )

src/scip/cons_or.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,7 @@ SCIP_RETCODE SCIPcreateConsOr(
22622262
}
22632263

22642264
/* check whether all variables are binary */
2265+
assert(vars != NULL || nvars == 0);
22652266
for( i = 0; i < nvars; ++i )
22662267
{
22672268
if( !SCIPvarIsBinary(vars[i]) )

src/scip/cons_setppc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7108,6 +7108,7 @@ SCIP_RETCODE createConsSetppc(
71087108
}
71097109

71107110
/* check whether all variables are binary */
7111+
assert(vars != NULL || nvars == 0);
71117112
for( i = 0; i < nvars; ++i )
71127113
{
71137114
if( !SCIPvarIsBinary(vars[i]) )

src/scip/cons_xor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,6 +4556,7 @@ SCIP_RETCODE createConsXorIntvar(
45564556
}
45574557

45584558
/* check whether all variables are binary */
4559+
assert(vars != NULL || nvars == 0);
45594560
for( i = 0; i < nvars; ++i )
45604561
{
45614562
if( !SCIPvarIsBinary(vars[i]) )
@@ -6042,6 +6043,7 @@ SCIP_RETCODE SCIPcreateConsXor(
60426043
}
60436044

60446045
/* check whether all variables are binary */
6046+
assert(vars != NULL || nvars == 0);
60456047
for( i = 0; i < nvars; ++i )
60466048
{
60476049
if( !SCIPvarIsBinary(vars[i]) )

src/scip/prop_symmetry.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,9 +2194,9 @@ SCIP_RETCODE ensureSymmetryMovedPermvarsCountsComputed(
21942194
propdata->nmovedintpermvars = 0;
21952195
propdata->nmovedcontpermvars = 0;
21962196

2197-
for (p = 0; p < propdata->nperms; ++p)
2197+
for (v = 0; v < propdata->npermvars; ++v)
21982198
{
2199-
for (v = 0; v < propdata->npermvars; ++v)
2199+
for (p = 0; p < propdata->nperms; ++p)
22002200
{
22012201
if ( propdata->perms[p][v] != v )
22022202
{
@@ -2217,6 +2217,7 @@ SCIP_RETCODE ensureSymmetryMovedPermvarsCountsComputed(
22172217
SCIPerrorMessage("unknown variable type\n");
22182218
return SCIP_INVALIDDATA;
22192219
} /*lint !e788*/
2220+
break;
22202221
}
22212222
}
22222223
}

tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ $(BINDIRS):
203203
.PHONY: test
204204
test: $(UNITTESTSBIN)
205205
make ctestrunner
206-
$(DISABLE_ASLR) --output-on-failure $(if $(FILTER), -R $(FILTER))
206+
$(DISABLE_ASLR) ctest --output-on-failure $(if $(FILTER), -R $(FILTER))
207207

208208
.PHONY: ctestrunner
209209
ctestrunner: $(UNITTESTSBIN)

0 commit comments

Comments
 (0)