Skip to content

SDPA fails to ignore comments on first two lines #1073

@odow

Description

@odow

From http://plato.asu.edu/ftp/sdpa_format.txt, bolded text below is not implemented:

  1. The first line after the comments contains m, the number of constraint
    matrices. Additional text on this line after m is ignored.
  1. The second line after the comments contains nblocks, the number of
    blocks in the block diagonal structure of the matrices. Additional text
    on this line after nblocks is ignored.
open("ex.sdpa", "w") do io
    write(io, """
"A sample problem.  
2 =mdim
2 =nblocks
2 2
10.0 20.0
0 1 1 1 1.0
0 1 2 2 2.0
0 2 1 1 3.0
0 2 2 2 4.0
1 1 1 1 1.0
1 1 2 2 1.0
2 1 2 2 1.0
2 2 1 1 5.0
2 2 1 2 2.0
2 2 2 2 6.0
""")
end
m = MOI.FileFormats.SDPA.Model()
MOI.read_from_file(m, "ex.sdpa")

# yields

ERROR: ArgumentError: extra characters after whitespace in "2 \"=mdim"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions