diff --git a/src/FileFormats/MOF/mof.schema.json b/src/FileFormats/MOF/mof.schema.json index 8bb513feb7..bf9fea9833 100644 --- a/src/FileFormats/MOF/mof.schema.json +++ b/src/FileFormats/MOF/mof.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/schema#", - "$id": "https://jump.dev/MathOptFormat/schemas/mof.1.8.schema.json", + "$id": "https://jump.dev/MathOptFormat/schemas/mof.1.9.schema.json", "title": "The schema for MathOptFormat", "type": "object", "required": ["version", "variables", "objective", "constraints"], @@ -11,7 +11,7 @@ "required": ["major", "minor"], "properties": { "major": {"const": 1}, - "minor": {"enum": [0, 1, 2, 3, 4, 5, 6, 7, 8]} + "minor": {"enum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]} } }, "name": { @@ -638,13 +638,21 @@ "dimension": {"type": "integer", "minimum": 1} } }, { - "description": "(u, v, w) ∈ {R^{dimension}: u ≥ Σᵢ wᵢlog(wᵢ/vᵢ), vᵢ ≥ 0, wᵢ ≥ 0}", + "description": "(u, v, w) ∈ {R^{dimension}: u ≥ Σᵢ wᵢlog(wᵢ/vᵢ), vᵢ > 0, wᵢ > 0}", "examples": ["{\"type\": \"RelativeEntropyCone\", \"dimension\": 3}"], "required": ["dimension"], "properties": { "type": {"const": "RelativeEntropyCone"}, "dimension": {"type": "integer", "minimum": 3} } + }, { + "description": "(u, v, w) ∈ {R^{dimension}: ∀i, wᵢ ≥ u(log(u/vᵢ) - 1), vᵢ > 0, u > 0}", + "examples": ["{\"type\": \"DualRelativeEntropyCone\", \"dimension\": 3}"], + "required": ["dimension"], + "properties": { + "type": {"const": "DualRelativeEntropyCone"}, + "dimension": {"type": "integer", "minimum": 3} + } }, { "description": "(t, X) ∈ {R^{1+row_dim×column_dim}: t ≥ σ₁(X)}", "examples": ["{\"type\": \"NormSpectralCone\", \"row_dim\": 1, \"column_dim\": 2}"], diff --git a/src/FileFormats/MOF/read.jl b/src/FileFormats/MOF/read.jl index d09be11d27..963fc90215 100644 --- a/src/FileFormats/MOF/read.jl +++ b/src/FileFormats/MOF/read.jl @@ -497,6 +497,7 @@ end NormInfinityCone, NormCone, RelativeEntropyCone, + DualRelativeEntropyCone, NormSpectralCone, NormNuclearCone, RootDetConeTriangle, @@ -632,6 +633,10 @@ function set_to_moi(::Val{:RelativeEntropyCone}, object::Dict) return MOI.RelativeEntropyCone(object["dimension"]) end +function set_to_moi(::Val{:DualRelativeEntropyCone}, object::Dict) + return MOI.DualRelativeEntropyCone(object["dimension"]) +end + function set_to_moi(::Val{:NormSpectralCone}, object::Dict) return MOI.NormSpectralCone(object["row_dim"], object["column_dim"]) end diff --git a/src/FileFormats/MOF/write.jl b/src/FileFormats/MOF/write.jl index 6cd60e469d..3e4dfc2c43 100644 --- a/src/FileFormats/MOF/write.jl +++ b/src/FileFormats/MOF/write.jl @@ -479,6 +479,7 @@ head_name(::Type{MOI.NormOneCone}) = "NormOneCone" head_name(::Type{MOI.NormInfinityCone}) = "NormInfinityCone" head_name(::Type{MOI.NormCone}) = "NormCone" head_name(::Type{MOI.RelativeEntropyCone}) = "RelativeEntropyCone" +head_name(::Type{MOI.DualRelativeEntropyCone}) = "DualRelativeEntropyCone" head_name(::Type{MOI.NormSpectralCone}) = "NormSpectralCone" head_name(::Type{MOI.NormNuclearCone}) = "NormNuclearCone" head_name(::Type{MOI.RootDetConeTriangle}) = "RootDetConeTriangle" diff --git a/test/FileFormats/MOF/test_MOF.jl b/test/FileFormats/MOF/test_MOF.jl index bc984e51fd..e274faabcc 100644 --- a/test/FileFormats/MOF/test_MOF.jl +++ b/test/FileFormats/MOF/test_MOF.jl @@ -1045,6 +1045,18 @@ function test_RelativeEntropyCone() ) end +function test_DualRelativeEntropyCone() + return _test_model_equality( + """ + variables: x, y, z + minobjective: x + c1: [x, y, z] in DualRelativeEntropyCone(3) + """, + ["x", "y", "z"], + ["c1"], + ) +end + function test_NormSpectralCone() return _test_model_equality( """