From f6b2b54a99e40c317b72d7a0aa35877ee940bcdf Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 3 Jul 2025 08:56:56 +1200 Subject: [PATCH 1/4] Fix expression comparisons on nightly --- src/Test/test_nonlinear.jl | 8 ++++---- test/FileFormats/MOF/MOF.jl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Test/test_nonlinear.jl b/src/Test/test_nonlinear.jl index 1d746a3665..83f0440721 100644 --- a/src/Test/test_nonlinear.jl +++ b/src/Test/test_nonlinear.jl @@ -76,10 +76,10 @@ function MOI.constraint_expr(::HS071, i::Int) ) elseif i == 2 return :( - x[$(MOI.VariableIndex(1))]^2 + - x[$(MOI.VariableIndex(2))]^2 + - x[$(MOI.VariableIndex(3))]^2 + - x[$(MOI.VariableIndex(4))]^2 == 40.0 + x[$(MOI.VariableIndex(1))]^2.0 + + x[$(MOI.VariableIndex(2))]^2.0 + + x[$(MOI.VariableIndex(3))]^2.0 + + x[$(MOI.VariableIndex(4))]^2.0 == 40.0 ) else error("Out of bounds constraint.") diff --git a/test/FileFormats/MOF/MOF.jl b/test/FileFormats/MOF/MOF.jl index 2e4297503b..7e77143a7d 100644 --- a/test/FileFormats/MOF/MOF.jl +++ b/test/FileFormats/MOF/MOF.jl @@ -308,7 +308,7 @@ function test_nonlinear_readingwriting() block = MOI.get(model2, MOI.NLPBlock()) MOI.initialize(block.evaluator, [:ExprGraph]) @test MOI.constraint_expr(block.evaluator, 1) == - :(2 * x[$x] + sin(x[$x])^2 - x[$y] == 1.0) + :(2.0 * x[$x] + sin(x[$x])^2.0 - x[$y] == 1.0) _validate(TEST_MOF_FILE) return end From acdd6596910110f8709c61fd9f1b8df833eefb73 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 3 Jul 2025 09:16:35 +1200 Subject: [PATCH 2/4] Update --- src/nlp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nlp.jl b/src/nlp.jl index 2a5b307674..7eb32e996e 100644 --- a/src/nlp.jl +++ b/src/nlp.jl @@ -1074,7 +1074,7 @@ julia> MOI.constraint_expr(evaluator, 1) :(x[MOI.VariableIndex(1)] * x[MOI.VariableIndex(2)] * x[MOI.VariableIndex(3)] * x[MOI.VariableIndex(4)] >= 25.0) julia> MOI.constraint_expr(evaluator, 2) -:(x[MOI.VariableIndex(1)] ^ 2 + x[MOI.VariableIndex(2)] ^ 2 + x[MOI.VariableIndex(3)] ^ 2 + x[MOI.VariableIndex(4)] ^ 2 == 40.0) +:(x[MOI.VariableIndex(1)] ^ 2.0 + x[MOI.VariableIndex(2)] ^ 2.0 + x[MOI.VariableIndex(3)] ^ 2.0 + x[MOI.VariableIndex(4)] ^ 2.0 == 40.0) ``` """ function constraint_expr end From b376511d240c878d47fc017a67c2030d98270b76 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 3 Jul 2025 09:41:51 +1200 Subject: [PATCH 3/4] Update --- test/FileFormats/MOF/nlp.mof.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/FileFormats/MOF/nlp.mof.json b/test/FileFormats/MOF/nlp.mof.json index e5df6fbaa1..24debfebd6 100644 --- a/test/FileFormats/MOF/nlp.mof.json +++ b/test/FileFormats/MOF/nlp.mof.json @@ -81,7 +81,7 @@ }, "set": { "type": "GreaterThan", - "lower": 25 + "lower": 25.0 } }, { @@ -96,28 +96,28 @@ "type": "^", "args": [ "var_1", - 2 + 2.0 ] }, { "type": "^", "args": [ "var_2", - 2 + 2.0 ] }, { "type": "^", "args": [ "var_3", - 2 + 2.0 ] }, { "type": "^", "args": [ "var_4", - 2 + 2.0 ] }, { @@ -145,7 +145,7 @@ }, "set": { "type": "EqualTo", - "value": 40 + "value": 40.0 } }, { From d9dd235f93c3de5230037fc6e286f4cb42488dcb Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 3 Jul 2025 09:48:35 +1200 Subject: [PATCH 4/4] Update --- test/Test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Test/runtests.jl b/test/Test/runtests.jl index cadb2d98ff..7233a7fb5f 100644 --- a/test/Test/runtests.jl +++ b/test/Test/runtests.jl @@ -229,7 +229,7 @@ function test_HS071_evaluator() @test MOI.constraint_expr(evaluator, 1) == :($(x[1]) * $(x[2]) * $(x[3]) * $(x[4]) >= 25.0) @test MOI.constraint_expr(evaluator, 2) == - :($(x[1])^2 + $(x[2])^2 + $(x[3])^2 + $(x[4])^2 == 40.0) + :($(x[1])^2.0 + $(x[2])^2.0 + $(x[3])^2.0 + $(x[4])^2.0 == 40.0) return end