diff --git a/Project.toml b/Project.toml index d2b37d0d5..e5f091eec 100644 --- a/Project.toml +++ b/Project.toml @@ -25,11 +25,11 @@ DocStringExtensions = "0.8" GenericLinearAlgebra = "0.2" IterativeSolvers = "0.8, 0.9" LinearMaps = "2.7, 3" -MathOptInterface = "0.10" +MathOptInterface = "0.10.6" PolynomialRoots = "1" Requires = "1" SpecialFunctions = "1.4, 2" -julia = "1.5" +julia = "1.6" [extras] DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07" diff --git a/src/MathOptInterface/wrapper.jl b/src/MathOptInterface/wrapper.jl index e5bfcea23..4117d0e26 100644 --- a/src/MathOptInterface/wrapper.jl +++ b/src/MathOptInterface/wrapper.jl @@ -110,7 +110,7 @@ function MOI.copy_to( # objective opt.obj_sense = MOI.MIN_SENSE model_c = zeros(T, n) - obj_offset = 0.0 + obj_offset = zero(T) for attr in MOI.get(src, MOI.ListOfModelAttributesSet()) if attr == MOI.Name() continue diff --git a/test/runmoitests.jl b/test/runmoitests.jl index 1660749e0..8c1f5c58d 100644 --- a/test/runmoitests.jl +++ b/test/runmoitests.jl @@ -25,14 +25,19 @@ include(joinpath(@__DIR__, "moicones.jl")) end end -@testset "MOI.Test tests" begin - println("\nstarting MOI.Test tests") - # TODO test other real types - T = Float64 +# real types, tolerances, and tests to include for MOI.Test tests +test_T = [ + (Float64, 2 * sqrt(sqrt(eps())), 4, String[]), + # TODO add test_linear after MOI 0.10.7 is tagged: + (BigFloat, 2 * eps(BigFloat)^0.2, 1, String["test_conic"]), +] + +@testset "MOI.Test tests: $T" for (T, tol_test, tol_relax, includes) in test_T + println("\nstarting MOI.Test tests: $T") model = MOI.Bridges.full_bridge_optimizer( MOI.Utilities.CachingOptimizer( MOI.Utilities.UniversalFallback(MOI.Utilities.Model{T}()), - Hypatia.Optimizer{T}(; default_tol_relax = 4), + Hypatia.Optimizer{T}(; default_tol_relax = tol_relax), ), T, ) @@ -41,8 +46,8 @@ end model, MOI.Test.Config( T, - atol = 2 * sqrt(sqrt(eps(T))), - rtol = 2 * sqrt(sqrt(eps(T))), + atol = tol_test, + rtol = tol_test, exclude = Any[ MOI.ConstraintBasisStatus, MOI.VariableBasisStatus, @@ -50,10 +55,9 @@ end MOI.SolverVersion, ], ), - # include = String["test_conic"], + include = includes, exclude = String[ - # TODO(odow): unexpected failure. But this is probably in the bridge - # layer, not Hypatia. + # TODO(odow): unexpected failure, probably in the bridge layer "test_model_UpperBoundAlreadySet", "test_model_LowerBoundAlreadySet", ],