Skip to content

Commit

Permalink
Merge branch 'remove-objoffset-variable' into 'master'
Browse files Browse the repository at this point in the history
Remove objoffset variable

See merge request integer/scip!3583
  • Loading branch information
svigerske committed Nov 12, 2024
2 parents 8f08293 + 1623bcb commit 8ddd43d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Fixed bugs
Miscellaneous
-------------

- add objective offset instead of objective offset variable in cip reader

Known bugs
----------

Expand Down
8 changes: 4 additions & 4 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ set(instances_PB
"instances/PseudoBoolean/normalized-90_rounds_0_errors.opb\;0"
"instances/PseudoBoolean/normalized-t2001.13queen13.1111218308.opb\;+infinity"
"instances/PseudoBoolean/normalized-t2001.13queen13.1110976730--soft-33-100-0.wbo\;4"
"instances/PseudoBoolean/wheel010.lap.opb.pre.cip\;25"
"instances/PseudoBoolean/wheel010.lap.opb.pre.cip\;16"
)

#
Expand Down Expand Up @@ -417,7 +417,7 @@ set(instances_Symmetry_A

set(instances_Symmetry_B
"instances/MIP/stein27_inf.lp\;+infinity"
"instances/PseudoBoolean/wheel010.lap.opb.pre.cip\;25"
"instances/PseudoBoolean/wheel010.lap.opb.pre.cip\;16"
)

#
Expand Down Expand Up @@ -808,7 +808,7 @@ foreach(instance ${instances_MIP_write})
endforeach(instance)

#
# test writing and reading from and to different file extensions for MIP
# test writing and reading from and to different file extensions for MIP (only without original objective offset)
#
foreach(instance ${instances_MIP})
split_instance(instance)
Expand Down Expand Up @@ -841,7 +841,7 @@ foreach(instance ${instances_MIP})
endforeach(instance)

#
# test writing and reading from and to different file extensions for PB
# test writing and reading from and to different file extensions for PB (only without original objective offset)
#
foreach(instance ${instances_PB})
split_instance(instance)
Expand Down
1 change: 0 additions & 1 deletion check/instances/PseudoBoolean/wheel010.lap.opb.pre.cip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ STATISTICS
Constraints : 273 initial, 273 maximal
OBJECTIVE
Sense : minimize
Offset : +9
VARIABLES
[binary] <t_x224>: obj=0, global bounds=[-0,1], local bounds=[-0,1]
[binary] <t_x143>: obj=1, global bounds=[-0,1], local bounds=[-0,1]
Expand Down
2 changes: 1 addition & 1 deletion check/testset/short.solu
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
=opt= normalized-mds_50_25_5 3
=opt= normalized-t2001.13queen13.1110976730--soft-33-100-0 4
=inf= normalized-t2001.13queen13.1111218308
=opt= wheel010.lap.opb.pre 25
=opt= wheel010.lap.opb.pre 16
=opt= bart10.shuffled 0
=opt= linking 2
=opt= j301_2 47
Expand Down
9 changes: 1 addition & 8 deletions src/scip/reader_cip.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,14 +866,7 @@ SCIP_DECL_READERREAD(readerReadCip)

if( !SCIPisZero(scip, objoffset) && !cipinput.haserror )
{
SCIP_VAR* objoffsetvar;

objoffset *= objscale;
SCIP_CALL( SCIPcreateVar(scip, &objoffsetvar, "objoffset", objoffset, objoffset, 1.0, SCIP_VARTYPE_CONTINUOUS,
TRUE, TRUE, NULL, NULL, NULL, NULL, NULL) );
SCIP_CALL( SCIPaddVar(scip, objoffsetvar) );
SCIP_CALL( SCIPreleaseVar(scip, &objoffsetvar) );
SCIPdebugMsg(scip, "added variables <objoffset> for objective offset of <%g>\n", objoffset);
SCIP_CALL( SCIPaddOrigObjoffset(scip, objscale * objoffset) );
}

if( cipinput.section != CIP_END && !cipinput.haserror )
Expand Down

0 comments on commit 8ddd43d

Please sign in to comment.