@@ -15309,18 +15309,19 @@ SCIP_RETCODE SCIPvarAddVlb(
15309
15309
/* the variable bound constraint defines a new upper bound */
15310
15310
if( SCIPsetIsGT(set, vlbcoef, 1.0) )
15311
15311
{
15312
- SCIP_Real newub = vlbconstant / (1.0 - vlbcoef);
15312
+ /* bound might be adjusted due to integrality condition */
15313
+ SCIP_Real newub = adjustedUb(set, SCIPvarIsIntegral(var), vlbconstant / (1.0 - vlbcoef));
15313
15314
15315
+ /* check bounds for feasibility */
15314
15316
if( SCIPsetIsFeasLT(set, newub, lb) )
15315
15317
{
15316
15318
*infeasible = TRUE;
15317
15319
return SCIP_OKAY;
15318
15320
}
15319
- else if( SCIPsetIsFeasLT(set, newub, ub) )
15320
- {
15321
- /* bound might be adjusted due to integrality condition */
15322
- newub = adjustedUb(set, SCIPvarIsIntegral(var), newub);
15323
15321
15322
+ /* improve global upper bound of variable */
15323
+ if( SCIPsetIsFeasLT(set, newub, ub) )
15324
+ {
15324
15325
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15325
15326
* with the local bound, in this case we need to store the bound change as pending bound change
15326
15327
*/
@@ -15345,22 +15346,21 @@ SCIP_RETCODE SCIPvarAddVlb(
15345
15346
/* the variable bound constraint defines a new lower bound */
15346
15347
else
15347
15348
{
15348
- SCIP_Real newlb;
15349
-
15350
15349
assert(SCIPsetIsLT(set, vlbcoef, 1.0));
15351
15350
15352
- newlb = vlbconstant / (1.0 - vlbcoef);
15351
+ /* bound might be adjusted due to integrality condition */
15352
+ SCIP_Real newlb = adjustedLb(set, SCIPvarIsIntegral(var), vlbconstant / (1.0 - vlbcoef));
15353
15353
15354
+ /* check bounds for feasibility */
15354
15355
if( SCIPsetIsFeasGT(set, newlb, ub) )
15355
15356
{
15356
15357
*infeasible = TRUE;
15357
15358
return SCIP_OKAY;
15358
15359
}
15359
- else if( SCIPsetIsFeasGT(set, newlb, lb) )
15360
- {
15361
- /* bound might be adjusted due to integrality condition */
15362
- newlb = adjustedLb(set, SCIPvarIsIntegral(var), newlb);
15363
15360
15361
+ /* improve global lower bound of variable */
15362
+ if( SCIPsetIsFeasGT(set, newlb, lb) )
15363
+ {
15364
15364
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15365
15365
* with the local bound, in this case we need to store the bound change as pending bound change
15366
15366
*/
@@ -15435,27 +15435,21 @@ SCIP_RETCODE SCIPvarAddVlb(
15435
15435
/* improve global bounds of vlb variable, and calculate minimal and maximal value of variable bound */
15436
15436
if( vlbcoef >= 0.0 )
15437
15437
{
15438
- SCIP_Real newzub;
15439
-
15440
15438
if( !SCIPsetIsInfinity(set, xub) )
15441
15439
{
15442
15440
/* x >= b*z + d -> z <= (x-d)/b */
15443
- newzub = (xub - vlbconstant)/vlbcoef;
15444
-
15445
- /* return if the new bound is less than -infinity */
15446
- if( SCIPsetIsInfinity(set, REALABS(newzub)) )
15447
- return SCIP_OKAY;
15441
+ SCIP_Real newzub = adjustedUb(set, SCIPvarIsIntegral(vlbvar), (xub - vlbconstant) / vlbcoef);
15448
15442
15443
+ /* check bounds for feasibility */
15449
15444
if( SCIPsetIsFeasLT(set, newzub, zlb) )
15450
15445
{
15451
15446
*infeasible = TRUE;
15452
15447
return SCIP_OKAY;
15453
15448
}
15449
+
15450
+ /* improve global upper bound of variable */
15454
15451
if( SCIPsetIsFeasLT(set, newzub, zub) )
15455
15452
{
15456
- /* bound might be adjusted due to integrality condition */
15457
- newzub = adjustedUb(set, SCIPvarIsIntegral(vlbvar), newzub);
15458
-
15459
15453
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15460
15454
* with the local bound, in this case we need to store the bound change as pending bound change
15461
15455
*/
@@ -15491,27 +15485,21 @@ SCIP_RETCODE SCIPvarAddVlb(
15491
15485
}
15492
15486
else
15493
15487
{
15494
- SCIP_Real newzlb;
15495
-
15496
15488
if( !SCIPsetIsInfinity(set, xub) )
15497
15489
{
15498
15490
/* x >= b*z + d -> z >= (x-d)/b */
15499
- newzlb = (xub - vlbconstant)/vlbcoef;
15500
-
15501
- /* return if the new bound is larger than infinity */
15502
- if( SCIPsetIsInfinity(set, REALABS(newzlb)) )
15503
- return SCIP_OKAY;
15491
+ SCIP_Real newzlb = adjustedLb(set, SCIPvarIsIntegral(vlbvar), (xub - vlbconstant) / vlbcoef);
15504
15492
15493
+ /* check bounds for feasibility */
15505
15494
if( SCIPsetIsFeasGT(set, newzlb, zub) )
15506
15495
{
15507
15496
*infeasible = TRUE;
15508
15497
return SCIP_OKAY;
15509
15498
}
15499
+
15500
+ /* improve global lower bound of variable */
15510
15501
if( SCIPsetIsFeasGT(set, newzlb, zlb) )
15511
15502
{
15512
- /* bound might be adjusted due to integrality condition */
15513
- newzlb = adjustedLb(set, SCIPvarIsIntegral(vlbvar), newzlb);
15514
-
15515
15503
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15516
15504
* with the local bound, in this case we need to store the bound change as pending bound change
15517
15505
*/
@@ -15558,12 +15546,10 @@ SCIP_RETCODE SCIPvarAddVlb(
15558
15546
*infeasible = TRUE;
15559
15547
return SCIP_OKAY;
15560
15548
}
15549
+
15561
15550
/* improve global lower bound of variable */
15562
15551
if( SCIPsetIsFeasGT(set, minvlb, xlb) )
15563
15552
{
15564
- /* bound might be adjusted due to integrality condition */
15565
- minvlb = adjustedLb(set, SCIPvarIsIntegral(var), minvlb);
15566
-
15567
15553
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15568
15554
* with the local bound, in this case we need to store the bound change as pending bound change
15569
15555
*/
@@ -15785,18 +15771,19 @@ SCIP_RETCODE SCIPvarAddVub(
15785
15771
/* the variable bound constraint defines a new lower bound */
15786
15772
if( SCIPsetIsGT(set, vubcoef, 1.0) )
15787
15773
{
15788
- SCIP_Real newlb = vubconstant / (1.0 - vubcoef);
15774
+ /* bound might be adjusted due to integrality condition */
15775
+ SCIP_Real newlb = adjustedLb(set, SCIPvarIsIntegral(var), vubconstant / (1.0 - vubcoef));
15789
15776
15777
+ /* check bounds for feasibility */
15790
15778
if( SCIPsetIsFeasGT(set, newlb, ub) )
15791
15779
{
15792
15780
*infeasible = TRUE;
15793
15781
return SCIP_OKAY;
15794
15782
}
15795
- else if( SCIPsetIsFeasGT(set, newlb, lb) )
15796
- {
15797
- /* bound might be adjusted due to integrality condition */
15798
- newlb = adjustedLb(set, SCIPvarIsIntegral(var), newlb);
15799
15783
15784
+ /* improve global lower bound of variable */
15785
+ if( SCIPsetIsFeasGT(set, newlb, lb) )
15786
+ {
15800
15787
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15801
15788
* with the local bound, in this case we need to store the bound change as pending bound change
15802
15789
*/
@@ -15821,22 +15808,21 @@ SCIP_RETCODE SCIPvarAddVub(
15821
15808
/* the variable bound constraint defines a new upper bound */
15822
15809
else
15823
15810
{
15824
- SCIP_Real newub;
15825
-
15826
15811
assert(SCIPsetIsLT(set, vubcoef, 1.0));
15827
15812
15828
- newub = vubconstant / (1.0 - vubcoef);
15813
+ /* bound might be adjusted due to integrality condition */
15814
+ SCIP_Real newub = adjustedUb(set, SCIPvarIsIntegral(var), vubconstant / (1.0 - vubcoef));
15829
15815
15816
+ /* check bounds for feasibility */
15830
15817
if( SCIPsetIsFeasLT(set, newub, lb) )
15831
15818
{
15832
15819
*infeasible = TRUE;
15833
15820
return SCIP_OKAY;
15834
15821
}
15835
- else if( SCIPsetIsFeasLT(set, newub, ub) )
15836
- {
15837
- /* bound might be adjusted due to integrality condition */
15838
- newub = adjustedUb(set, SCIPvarIsIntegral(var), newub);
15839
15822
15823
+ /* improve global upper bound of variable */
15824
+ if( SCIPsetIsFeasLT(set, newub, ub) )
15825
+ {
15840
15826
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15841
15827
* with the local bound, in this case we need to store the bound change as pending bound change
15842
15828
*/
@@ -15911,22 +15897,21 @@ SCIP_RETCODE SCIPvarAddVub(
15911
15897
/* improve global bounds of vub variable, and calculate minimal and maximal value of variable bound */
15912
15898
if( vubcoef >= 0.0 )
15913
15899
{
15914
- SCIP_Real newzlb;
15915
-
15916
15900
if( !SCIPsetIsInfinity(set, -xlb) )
15917
15901
{
15918
15902
/* x <= b*z + d -> z >= (x-d)/b */
15919
- newzlb = (xlb - vubconstant)/vubcoef;
15903
+ SCIP_Real newzlb = adjustedLb(set, SCIPvarIsIntegral(vubvar), (xlb - vubconstant) / vubcoef);
15904
+
15905
+ /* check bounds for feasibility */
15920
15906
if( SCIPsetIsFeasGT(set, newzlb, zub) )
15921
15907
{
15922
15908
*infeasible = TRUE;
15923
15909
return SCIP_OKAY;
15924
15910
}
15911
+
15912
+ /* improve global lower bound of variable */
15925
15913
if( SCIPsetIsFeasGT(set, newzlb, zlb) )
15926
15914
{
15927
- /* bound might be adjusted due to integrality condition */
15928
- newzlb = adjustedLb(set, SCIPvarIsIntegral(vubvar), newzlb);
15929
-
15930
15915
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15931
15916
* with the local bound, in this case we need to store the bound change as pending bound change
15932
15917
*/
@@ -15962,22 +15947,21 @@ SCIP_RETCODE SCIPvarAddVub(
15962
15947
}
15963
15948
else
15964
15949
{
15965
- SCIP_Real newzub;
15966
-
15967
15950
if( !SCIPsetIsInfinity(set, -xlb) )
15968
15951
{
15969
15952
/* x <= b*z + d -> z <= (x-d)/b */
15970
- newzub = (xlb - vubconstant)/vubcoef;
15953
+ SCIP_Real newzub = adjustedUb(set, SCIPvarIsIntegral(vubvar), (xlb - vubconstant) / vubcoef);
15954
+
15955
+ /* check bounds for feasibility */
15971
15956
if( SCIPsetIsFeasLT(set, newzub, zlb) )
15972
15957
{
15973
15958
*infeasible = TRUE;
15974
15959
return SCIP_OKAY;
15975
15960
}
15961
+
15962
+ /* improve global upper bound of variable */
15976
15963
if( SCIPsetIsFeasLT(set, newzub, zub) )
15977
15964
{
15978
- /* bound might be adjusted due to integrality condition */
15979
- newzub = adjustedUb(set, SCIPvarIsIntegral(vubvar), newzub);
15980
-
15981
15965
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
15982
15966
* with the local bound, in this case we need to store the bound change as pending bound change
15983
15967
*/
@@ -16028,9 +16012,6 @@ SCIP_RETCODE SCIPvarAddVub(
16028
16012
/* improve global upper bound of variable */
16029
16013
if( SCIPsetIsFeasLT(set, maxvub, xub) )
16030
16014
{
16031
- /* bound might be adjusted due to integrality condition */
16032
- maxvub = adjustedUb(set, SCIPvarIsIntegral(var), maxvub);
16033
-
16034
16015
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
16035
16016
* with the local bound, in this case we need to store the bound change as pending bound change
16036
16017
*/
0 commit comments