@@ -9623,7 +9623,8 @@ SCIP_RETCODE convertLongEquality(
9623
9623
SCIP_CONS* cons, /**< linear constraint */
9624
9624
SCIP_Bool* cutoff, /**< pointer to store TRUE, if a cutoff was found */
9625
9625
int* naggrvars, /**< pointer to count number of aggregated variables */
9626
- int* ndelconss /**< pointer to count number of deleted constraints */
9626
+ int* ndelconss, /**< pointer to count number of deleted constraints */
9627
+ int* nchgvartypes /**< pointer to count number of changed variable types */
9627
9628
)
9628
9629
{
9629
9630
SCIP_CONSDATA* consdata;
@@ -9761,6 +9762,7 @@ SCIP_RETCODE convertLongEquality(
9761
9762
if( absval > maxabsval )
9762
9763
maxabsval = absval;
9763
9764
9765
+ /*TODO: why exit here when implied integrality can still be derived?!*/
9764
9766
/* do not try to multi aggregate, when numerical bad */
9765
9767
if( maxabsval / minabsval > conshdlrdata->maxmultaggrquot )
9766
9768
return SCIP_OKAY;
@@ -9942,6 +9944,7 @@ SCIP_RETCODE convertLongEquality(
9942
9944
}
9943
9945
assert(!samevar || (supinf > 0 && infinf > 0));
9944
9946
9947
+ /*TODO: implint detection again terminates early here*/
9945
9948
/* If the infimum and the supremum of a multi-aggregation are both infinite, then the multi-aggregation might not be resolvable.
9946
9949
* E.g., consider the equality z = x-y. If x and y are both fixed to +infinity, the value for z is not determined */
9947
9950
if( (samevar && (supinf > 1 || infinf > 1)) || (!samevar && supinf > 0 && infinf > 0) )
@@ -10049,6 +10052,7 @@ SCIP_RETCODE convertLongEquality(
10049
10052
SCIPdebugMsg(scip, "linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
10050
10053
SCIPconsGetName(cons), SCIPvarGetName(var));
10051
10054
SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_IMPLINT, &infeasible) );
10055
+ (*nchgvartypes)++;
10052
10056
if( infeasible )
10053
10057
{
10054
10058
SCIPdebugMsg(scip, "infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
@@ -10143,6 +10147,7 @@ SCIP_RETCODE convertLongEquality(
10143
10147
SCIPdebugMsg(scip, "linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
10144
10148
SCIPconsGetName(cons), SCIPvarGetName(var));
10145
10149
SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_IMPLINT, &infeasible) );
10150
+ (*nchgvartypes)++;
10146
10151
if( infeasible )
10147
10152
{
10148
10153
SCIPdebugMsg(scip, "infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
@@ -10487,7 +10492,8 @@ SCIP_RETCODE convertEquality(
10487
10492
SCIP_Bool* cutoff, /**< pointer to store TRUE, if a cutoff was found */
10488
10493
int* nfixedvars, /**< pointer to count number of fixed variables */
10489
10494
int* naggrvars, /**< pointer to count number of aggregated variables */
10490
- int* ndelconss /**< pointer to count number of deleted constraints */
10495
+ int* ndelconss, /**< pointer to count number of deleted constraints */
10496
+ int* nchgvartypes /**< pointer to count number of changed variable types */
10491
10497
)
10492
10498
{
10493
10499
SCIP_CONSDATA* consdata;
@@ -10525,7 +10531,7 @@ SCIP_RETCODE convertEquality(
10525
10531
SCIP_CALL( checkPartialObjective(scip, cons, conshdlrdata) );
10526
10532
10527
10533
/* try to multi-aggregate one of the variables */
10528
- SCIP_CALL( convertLongEquality(scip, conshdlrdata, cons, cutoff, naggrvars, ndelconss) );
10534
+ SCIP_CALL( convertLongEquality(scip, conshdlrdata, cons, cutoff, naggrvars, ndelconss, nchgvartypes ) );
10529
10535
}
10530
10536
10531
10537
return SCIP_OKAY;
@@ -10613,7 +10619,8 @@ SCIP_RETCODE dualPresolve(
10613
10619
SCIP_Bool* cutoff, /**< pointer to store TRUE, if a cutoff was found */
10614
10620
int* nfixedvars, /**< pointer to count number of fixed variables */
10615
10621
int* naggrvars, /**< pointer to count number of aggregated variables */
10616
- int* ndelconss /**< pointer to count number of deleted constraints */
10622
+ int* ndelconss, /**< pointer to count number of deleted constraints */
10623
+ int* nchgvartypes /**< pointer to count number of changed variable types */
10617
10624
)
10618
10625
{
10619
10626
SCIP_CONSDATA* consdata;
@@ -11040,6 +11047,7 @@ SCIP_RETCODE dualPresolve(
11040
11047
if( SCIPvarGetType(aggrvars[j]) == SCIP_VARTYPE_IMPLINT )
11041
11048
{
11042
11049
SCIP_CALL( SCIPchgVarType(scip, aggrvars[j], SCIP_VARTYPE_INTEGER, &infeasiblevartypechg) );
11050
+ (*nchgvartypes)++;
11043
11051
assert(!infeasiblevartypechg);
11044
11052
}
11045
11053
}
@@ -14597,7 +14605,8 @@ SCIP_RETCODE fullDualPresolve(
14597
14605
SCIP_CONS** conss, /**< constraint set */
14598
14606
int nconss, /**< number of constraints */
14599
14607
SCIP_Bool* cutoff, /**< pointer to store TRUE, if a cutoff was found */
14600
- int* nchgbds /**< pointer to count the number of bound changes */
14608
+ int* nchgbds, /**< pointer to count the number of bound changes */
14609
+ int* nchgvartypes /**< pointer to count the number of variable type changes */
14601
14610
)
14602
14611
{
14603
14612
SCIP_Real* redlb;
@@ -15032,7 +15041,7 @@ SCIP_RETCODE fullDualPresolve(
15032
15041
{
15033
15042
/* since we locally copied the variable array we can change the variable type immediately */
15034
15043
SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_IMPLINT, &infeasible) );
15035
-
15044
+ (*nchgvartypes)++;
15036
15045
if( infeasible )
15037
15046
{
15038
15047
SCIPdebugMsg(scip, "infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
@@ -16592,13 +16601,13 @@ SCIP_DECL_CONSPRESOL(consPresolLinear)
16592
16601
/* convert special equalities */
16593
16602
if( !cutoff && SCIPconsIsActive(cons) )
16594
16603
{
16595
- SCIP_CALL( convertEquality(scip, cons, conshdlrdata, &cutoff, nfixedvars, naggrvars, ndelconss) );
16604
+ SCIP_CALL( convertEquality(scip, cons, conshdlrdata, &cutoff, nfixedvars, naggrvars, ndelconss, nchgvartypes ) );
16596
16605
}
16597
16606
16598
16607
/* apply dual presolving for variables that appear in only one constraint */
16599
16608
if( !cutoff && SCIPconsIsActive(cons) && conshdlrdata->dualpresolving && SCIPallowStrongDualReds(scip) )
16600
16609
{
16601
- SCIP_CALL( dualPresolve(scip, conshdlrdata, cons, &cutoff, nfixedvars, naggrvars, ndelconss) );
16610
+ SCIP_CALL( dualPresolve(scip, conshdlrdata, cons, &cutoff, nfixedvars, naggrvars, ndelconss, nchgvartypes ) );
16602
16611
}
16603
16612
16604
16613
/* check if an inequality is parallel to the objective function */
@@ -16732,7 +16741,7 @@ SCIP_DECL_CONSPRESOL(consPresolLinear)
16732
16741
{
16733
16742
if( conshdlrdata->dualpresolving && SCIPallowStrongDualReds(scip) && !SCIPisStopped(scip) )
16734
16743
{
16735
- SCIP_CALL( fullDualPresolve(scip, conss, nconss, &cutoff, nchgbds) );
16744
+ SCIP_CALL( fullDualPresolve(scip, conss, nconss, &cutoff, nchgbds, nchgvartypes ) );
16736
16745
}
16737
16746
}
16738
16747
0 commit comments