Skip to content

Commit 953358d

Browse files
committed
Resolve "fails to read valid free-form MPS file"
1 parent 0ef9f15 commit 953358d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Release 7.1.6
44
fixed bugs:
55
- fixed that SoPlex_objValueRationalString did not calculate the required string length correctly
66
- clear vector before modifying number of non-zeros in SSVectorBase<R>::assign2productShort() of basevectors.h to avoid uninitialized indexing
7+
- also check whitespace at fourth position and only rely on length in row section in MPSInput::readLine() to detect more free MPS formats
78

89
code quality:
910
- reorganize NameSet::number() to avoid one hash table lookup and remove false compiler warning

src/soplex/mpsinput.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ bool MPSInput::readLine()
137137

138138
/* Test for fixed format
139139
*/
140-
space = m_buf[12] | m_buf[13]
140+
space = m_buf[3]
141+
| m_buf[12] | m_buf[13]
141142
| m_buf[22] | m_buf[23]
142143
| m_buf[36] | m_buf[37] | m_buf[38]
143144
| m_buf[47] | m_buf[48]
144145
| m_buf[61] | m_buf[62] | m_buf[63];
145146

146-
if(space == BLANK || len < 13)
147+
if(space == BLANK)
147148
{
148149
/* Now we have space at the right positions.
149150
* But are there also the non space where they
@@ -159,7 +160,7 @@ bool MPSInput::readLine()
159160
/* len < 13 is handle ROW lines with embedded spaces
160161
* in the names correctly
161162
*/
162-
if(number || len < 13)
163+
if((m_section != ROWS && number) || (m_section == ROWS && len < 13))
163164
{
164165
/* Now we assume fixed format, so we patch possible embedded spaces.
165166
*/
@@ -169,9 +170,7 @@ bool MPSInput::readLine()
169170
}
170171
else
171172
{
172-
if(m_section == COLUMNS || m_section == RHS
173-
|| m_section == RANGES || m_section == BOUNDS)
174-
m_is_new_format = true;
173+
m_is_new_format = true;
175174
}
176175
}
177176
else

0 commit comments

Comments
 (0)