Skip to content

Commit 9cc15f4

Browse files
committed
Ignore comments aftere m and nblocks
1 parent 8a65679 commit 9cc15f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/FileFormats/SDPA/SDPA.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,16 @@ function Base.read!(io::IO, model::Model{T}) where T
256256
continue
257257
end
258258
num_variables_read = true
259-
MOI.add_variables(model, parse(Int, line))
259+
# According to http://plato.asu.edu/ftp/sdpa_format.txt,
260+
# additional text after the number of variables should be ignored.
261+
MOI.add_variables(model, parse(Int, split(line)[1]))
260262
elseif num_blocks === nothing
261263
if isempty(line)
262264
continue
263265
end
264-
num_blocks = parse(Int, line)
266+
# According to http://plato.asu.edu/ftp/sdpa_format.txt,
267+
# additional text after the number of blocks should be ignored.
268+
num_blocks = parse(Int, split(line)[1])
265269
elseif block_sets === nothing
266270
if isempty(line) && !iszero(num_blocks)
267271
continue

0 commit comments

Comments
 (0)