Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v80-bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed Sep 12, 2023
2 parents bf24f8a + 4d108e9 commit 77f66c6
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,7 @@ examples/*/doc/userguide.*
examples/*/!doc/userguide.tex
examples/*/lint


!.github/workflows/*

# avoid ignoring files in ci folder
!ci/*
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: 'ci/test_russcip.yml'
9 changes: 5 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ Known bugs
Fixed bugs
----------

- fixed that scaling of rows in Gurobi interface (SCIPlpiScaleRow()) changed infinite sides to large finite ones (1e20) when scale factor is negative
- check whether objective limit is truly reached in SCIPlpiIsStable()
- if an objective limit is set and Mosek claims that it is exceeded, check that this is indeed the case in SCIPlpiIsStable()
- the .mps file reader was extended to additionally accept .mps files with the objective sense section on one line
- ensure that delayed cutpool separation does not happen if enough cuts have been found already
- fixed that a Gurobi or Mosek interface (LPI) could not be freed from a thread different than the one it was created in, which lead to problems when, e.g., using the concurrent optimizer
- in cons_varbound if both variables are fixed, instead of propagating the constraint check the feasibility of the constraint since propagating can lead to unnecessary numerical troubles
Expand All @@ -194,6 +198,7 @@ Fixed bugs
- restrict separator intobj to solutions for which there can be no better feasible integral objective values to avoid cutting them off
- delay removal of clique lists from SCIPvarRemoveCliquesImplicsVbs() into cliqueCleanup() to avoid segmentation faults by incomplete cleanups after variable conversions
- reject sub-solutions with invalid objectives in SCIPtranslateSubSols() due to contradicting infinite contributions
- correct column index in getMinMaxActivityResiduals() to make presolver dualinfer work

@section RN804 SCIP 8.0.4
*************************
Expand Down Expand Up @@ -260,10 +265,6 @@ Fixed bugs
- only consider positive slack variables as active in benders.c
- in the feasibility check of and/or constraints, allow for fractional values in operands
- fixed linear outer-approximation for some composite absolute-value expressions
- fixed that scaling of rows in Gurobi interface (SCIPlpiScaleRow()) changed infinite sides to large finite ones (1e20) when scale factor is negative
- check whether objective limit is truly reached in SCIPlpiIsStable()
- if an objective limit is set and Mosek claims that it is exceeded, check that this is indeed the case in SCIPlpiIsStable()
- The .mps file reader was extended to additionally accept .mps files with the objective sense section on one line.

Miscellaneous
-------------
Expand Down
1 change: 1 addition & 0 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ set(instances_Or
# Pairs of instances and settings
#
set(pairs_Issue
"instances/Issue/3047.lp\;20000\;dualinfer"
"instances/Issue/3499.lp\;11460\;closeobj"
"instances/Issue/3589.cip\;-1\;default"
"instances/Issue/3610.cip\;0\;default"
Expand Down
1 change: 1 addition & 0 deletions check/coverage/settings/dualinfer.set
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
presolving/dualinfer/maxrounds = -1
16 changes: 16 additions & 0 deletions check/instances/Issue/3047.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
\ SCIP STATISTICS
\ Problem name : MPSXNAME
\ Variables : 4 (0 binary, 0 integer, 0 implicit integer, 4 continuous)
\ Constraints : 3
Minimize
Obj: +25 X0
Subject to
X7: +8 X0 +4 X1 +7 X2 +7 X4 = +25200
X8: +28 X0 +39 X1 -63 X2 -13 X4 <= +3200
X12: -8 X0 +21 X1 -7 X2 +43 X4 <= +4800
Bounds
0 <= X0 <= 1000
0 <= X1 <= 3000
0 <= X2 <= 2000
0 <= X4 <= 2600
End
21 changes: 21 additions & 0 deletions ci/build_scip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# install dependencies
apt-get update
apt-get install -y cmake g++ git clang

# build soplex
git clone https://github.com/scipopt/soplex.git
cd soplex
git checkout bugfix-60
mkdir build
cd build
cmake ..
make -j
cd ../..

# build scip in `install` directory
mkdir build
cd build
cmake .. -DAUTOBUILD=ON -DSOPLEX_DIR=soplex/build -DCMAKE_INSTALL_PREFIX=../install
make -j
make install
cd ..
12 changes: 12 additions & 0 deletions ci/test_russcip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test_russcip:
image:
name: rust:latest
script:
- sh ci/build_scip.sh
- git clone https://github.com/scipopt/russcip.git
- cd russcip
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/install/lib SCIPOPTDIR=$CI_PROJECT_DIR/install
- cargo test --release

only:
- merge_requests
7 changes: 7 additions & 0 deletions src/scip/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ SCIP_Real SCIPclockGetTime(
}
}

/* time typically moves forward
* but when compiler optimizations meet fast CPUs, then rounding errors create small timetravel
*/
assert(!EPSN(result, 1e-12));
if( result < 0.0 )
result = 0.0;

clck->lasttime = result;
return result;
}
Expand Down
7 changes: 5 additions & 2 deletions src/scip/presol_dualinfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static
void getMinMaxActivityResiduals(
SCIP* scip, /**< SCIP main data structure */
SCIP_MATRIX* matrix, /**< matrix containing the constraints */
int col, /**< column index */
int withoutcol, /**< exclude this column index */
int row, /**< row index */
SCIP_Real* lbs, /**< lower bounds */
SCIP_Real* ubs, /**< upper bounds */
Expand All @@ -739,6 +739,7 @@ void getMinMaxActivityResiduals(
int nminactposinf;
SCIP_Real maxresact;
SCIP_Real minresact;
int col;

assert(scip != NULL);
assert(matrix != NULL);
Expand All @@ -763,7 +764,9 @@ void getMinMaxActivityResiduals(

for( ; rowpnt < rowend; rowpnt++, valpnt++ )
{
if(*rowpnt == col)
col = *rowpnt;

if( col == withoutcol )
continue;

coef = *valpnt;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/expr/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ Test(evalexpr, complicated, .description = "Tests expression evaluation for a la

/* evaluate solution with zero tag */
printf("evaluate expression with a zero tag\n");
for( i = 1; i < 100; ++i )
for( i = 1; i < 50; ++i )
{
SCIP_CALL( SCIPsetSolVal(scip, sol, x, i*i) );
SCIP_CALL( SCIPsetSolVal(scip, sol, y, -5.0/i) );
Expand Down
24 changes: 12 additions & 12 deletions tests/src/expr/sin/estimation.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ Test(separation, sine_x,

success = computeEstimatorsTrig(scip, expr, &lincoef, &linconst, 1.5, childlb, childub, FALSE);
cr_expect(success);
cr_expect_eq(linconst, -1.5 * cos(1.5) + sin(1.5));
cr_expect_eq(lincoef, cos(1.5));
EXPECTFEQ(linconst, -1.5 * cos(1.5) + sin(1.5));
EXPECTFEQ(lincoef, cos(1.5));

/*
* test underestimation
*/

success = computeEstimatorsTrig(scip, expr, &lincoef, &linconst, 4.8, childlb, childub, TRUE);
cr_expect(success);
cr_expect_eq(linconst, -4.8 * cos(4.8) + sin(4.8));
cr_expect_eq(lincoef, cos(4.8));
EXPECTFEQ(linconst, -4.8 * cos(4.8) + sin(4.8));
EXPECTFEQ(lincoef, cos(4.8));

/*
* test point where solution tangent is not feasible
Expand Down Expand Up @@ -246,17 +246,17 @@ Test(separation, sine_y,

success = computeEstimatorsTrig(scip, expr, &lincoef, &linconst, -4.0, childlb, childub, FALSE);
cr_expect(success);
cr_expect_eq(linconst, 4 * cos(-4) + sin(-4));
cr_expect_eq(lincoef, cos(-4));
EXPECTFEQ(linconst, 4 * cos(-4) + sin(-4));
EXPECTFEQ(lincoef, cos(-4));

/*
* test underestimation (not possible in this case)
*/

success = computeEstimatorsTrig(scip, expr, &lincoef, &linconst, -3.1, childlb, childub, TRUE);
cr_expect(success);
cr_expect_eq(linconst, -sin(-6) + 2.0 * sin(-3));
cr_expect_eq(lincoef, (sin(-3) - sin(-6)) / 3.0);
EXPECTFEQ(linconst, -sin(-6) + 2.0 * sin(-3));
EXPECTFEQ(lincoef, (sin(-3) - sin(-6)) / 3.0);

/*
* test point where solution tangent is not underestimating
Expand Down Expand Up @@ -348,8 +348,8 @@ Test(separation, sine_z,

success = computeEstimatorsTrig(scip, expr, &lincoef, &linconst, 2.0, childlb, childub, FALSE);
cr_expect(success);
cr_expect_eq(linconst, -2 * cos(2) + sin(2));
cr_expect_eq(lincoef, cos(2));
EXPECTFEQ(linconst, -2 * cos(2) + sin(2));
EXPECTFEQ(lincoef, cos(2));

/* note: solution underestimation doesn't make sense in [1,3] */

Expand All @@ -360,8 +360,8 @@ Test(separation, sine_z,
cr_expect(success);

/* check secant */
cr_expect_eq(linconst, -0.5 * sin(3) + 1.5 * sin(1));
cr_expect_eq(lincoef, 0.5 * (sin(3) - sin(1)));
EXPECTFEQ(linconst, -0.5 * sin(3) + 1.5 * sin(1));
EXPECTFEQ(lincoef, 0.5 * (sin(3) - sin(1)));

/* release expression */
SCIP_CALL( SCIPreleaseExpr(scip, &expr) );
Expand Down

0 comments on commit 77f66c6

Please sign in to comment.