Skip to content

Commit eadef60

Browse files
authored
Merge pull request ERGO-Code#2252 from fwesselm/twoFixes
Fix issue 2204
2 parents 58a9fd1 + a543e2c commit eadef60

File tree

5 files changed

+285
-178
lines changed

5 files changed

+285
-178
lines changed

check/TestMipSolver.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,3 +820,15 @@ TEST_CASE("issue-2171", "[highs_test_mip_solver]") {
820820
const double optimal_objective = -22375.7585461;
821821
solve(highs, kHighsOnString, require_model_status, optimal_objective);
822822
}
823+
824+
TEST_CASE("issue-2204", "[highs_test_mip_solver]") {
825+
std::string filename = std::string(HIGHS_DIR) + "/check/instances/issue-2204.mps";
826+
Highs highs;
827+
highs.setOptionValue("output_flag", dev_run);
828+
highs.setOptionValue("mip_rel_gap", 0);
829+
highs.setOptionValue("mip_abs_gap", 0);
830+
highs.readModel(filename);
831+
const HighsModelStatus require_model_status = HighsModelStatus::kOptimal;
832+
const double optimal_objective = 6.0;
833+
solve(highs, kHighsOnString, require_model_status, optimal_objective);
834+
}

check/instances/issue-2204.mps

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
NAME
2+
ROWS
3+
N Obj
4+
E r0
5+
E r1
6+
E r2
7+
E r3
8+
E r4
9+
E r5
10+
E r6
11+
E r7
12+
E r8
13+
E r9
14+
E r10
15+
E r11
16+
COLUMNS
17+
MARK0000 'MARKER' 'INTORG'
18+
c0 Obj 1
19+
c0 r8 1
20+
c1 Obj 1
21+
c1 r0 1
22+
c1 r8 1
23+
c2 Obj 1
24+
c2 r0 1
25+
c2 r10 1
26+
c3 Obj 1
27+
c3 r1 1
28+
c3 r10 1
29+
c4 Obj 1
30+
c4 r1 1
31+
c5 Obj 1
32+
c5 r2 1
33+
c6 Obj 1
34+
c6 r0 1
35+
c6 r2 1
36+
c7 Obj 1
37+
c7 r0 1
38+
c7 r3 1
39+
c8 Obj 1
40+
c8 r1 1
41+
c8 r3 1
42+
c9 Obj 1
43+
c9 r1 1
44+
c10 Obj 1
45+
c10 r2 1
46+
c11 Obj 1
47+
c11 r2 1
48+
c11 r4 1
49+
c12 Obj 1
50+
c12 r3 1
51+
c12 r4 1
52+
c13 Obj 1
53+
c13 r3 1
54+
c13 r5 1
55+
c14 Obj 1
56+
c14 r5 1
57+
c15 Obj 1
58+
c15 r6 1
59+
c16 Obj 1
60+
c16 r4 1
61+
c16 r6 1
62+
c17 Obj 1
63+
c17 r4 1
64+
c17 r7 1
65+
c18 Obj 1
66+
c18 r5 1
67+
c18 r7 1
68+
c19 Obj 1
69+
c19 r5 1
70+
c20 Obj 1
71+
c20 r6 1
72+
c21 Obj 1
73+
c21 r6 1
74+
c21 r9 1
75+
c22 Obj 1
76+
c22 r7 1
77+
c22 r9 1
78+
c23 Obj 1
79+
c23 r7 1
80+
c23 r11 1
81+
c24 Obj 1
82+
c24 r11 1
83+
c25 r0 -2
84+
c26 r1 -2
85+
c27 r2 -2
86+
c28 r3 -2
87+
c29 r4 -2
88+
c30 r5 -2
89+
c31 r6 -2
90+
c32 r7 -2
91+
c33 r8 -2
92+
c34 r9 -2
93+
c35 r10 -2
94+
c36 r11 -2
95+
MARK0001 'MARKER' 'INTEND'
96+
RHS
97+
RHS_V r0 1
98+
RHS_V r1 1
99+
RHS_V r3 1
100+
RHS_V r4 1
101+
RHS_V r5 1
102+
RHS_V r9 1
103+
RHS_V r10 1
104+
RHS_V r11 1
105+
BOUNDS
106+
BV BOUND c0
107+
BV BOUND c1
108+
BV BOUND c2
109+
BV BOUND c3
110+
BV BOUND c4
111+
BV BOUND c5
112+
BV BOUND c6
113+
BV BOUND c7
114+
BV BOUND c8
115+
BV BOUND c9
116+
BV BOUND c10
117+
BV BOUND c11
118+
BV BOUND c12
119+
BV BOUND c13
120+
BV BOUND c14
121+
BV BOUND c15
122+
BV BOUND c16
123+
BV BOUND c17
124+
BV BOUND c18
125+
BV BOUND c19
126+
BV BOUND c20
127+
BV BOUND c21
128+
BV BOUND c22
129+
BV BOUND c23
130+
BV BOUND c24
131+
FR BOUND c25
132+
FR BOUND c26
133+
FR BOUND c27
134+
FR BOUND c28
135+
FR BOUND c29
136+
FR BOUND c30
137+
FR BOUND c31
138+
FR BOUND c32
139+
FR BOUND c33
140+
FR BOUND c34
141+
FR BOUND c35
142+
FR BOUND c36
143+
ENDATA

src/mip/HighsMipSolver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@ bool HighsMipSolver::solutionFeasible(
880880

881881
obj = lp->offset_;
882882

883-
if (kAllowDeveloperAssert) assert(HighsInt(col_value.size()) == lp->num_col_);
883+
if (kAllowDeveloperAssert)
884+
assert(col_value.size() == static_cast<size_t>(lp->num_col_));
884885
for (HighsInt i = 0; i != lp->num_col_; ++i) {
885886
const double value = col_value[i];
886887
obj += lp->col_cost_[i] * value;
@@ -911,7 +912,7 @@ bool HighsMipSolver::solutionFeasible(
911912
std::vector<double> row_value;
912913
if (pass_row_value) {
913914
if (kAllowDeveloperAssert)
914-
assert(HighsInt((*pass_row_value).size()) == lp->num_col_);
915+
assert((*pass_row_value).size() == static_cast<size_t>(lp->num_row_));
915916
} else {
916917
calculateRowValuesQuad(*lp, col_value, row_value);
917918
}

0 commit comments

Comments
 (0)