-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Labels
Status: help wantedThis issue needs could use help from the communityThis issue needs could use help from the communitySubmodule: FileFormatsAbout the FileFormats submoduleAbout the FileFormats submodule
Milestone
Description
Writing
Currently, the CBF writer assumes all variables are in the "F" (MOI.Reals) cone.
MathOptInterface.jl/src/FileFormats/CBF/write.jl
Lines 252 to 253 in 7a95b63
| println(io, num_var, " 1") | |
| println(io, "F ", num_var) |
We should add support for add_constrained_variables and then dis-allow VectorOfVariables constraints:
| _add_cones(data, model, MOI.VectorOfVariables, S) |
since we end up writing
VectorOfVariables constraints as a affine-in-set anyway:MathOptInterface.jl/src/FileFormats/CBF/write.jl
Lines 55 to 61 in 7a95b63
| function _add_function(data, f::MOI.VectorOfVariables, ::Any) | |
| for v in f.variables | |
| data.num_rows += 1 | |
| push!(data.acoord, (data.num_rows, v.value, 1.0)) | |
| end | |
| return | |
| end |
Reading
This should be changed to add_constrained_variable:
MathOptInterface.jl/src/FileFormats/CBF/read.jl
Lines 155 to 159 in 7a95b63
| MOI.add_constraint( | |
| model, | |
| MOI.VectorOfVariables(data.scalar_vars[var_idx.+indices]), | |
| _cbf_to_moi_cone(data, cone_str, cone_dim), | |
| ) |
Metadata
Metadata
Assignees
Labels
Status: help wantedThis issue needs could use help from the communityThis issue needs could use help from the communitySubmodule: FileFormatsAbout the FileFormats submoduleAbout the FileFormats submodule