-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix method ambiguities and limit operate to Number subtypes #2224
Conversation
Maybe we could add tests actually |
What we really need to do is fix: julia> Test.detect_ambiguities(MOI; recursive = true)
41-element Vector{Tuple{Method, Method}}:
[...] |
There are lots of these that are pedantic. Like
would only happen for They mostly stem from cases where julia> for (a, b) in Test.detect_ambiguities(MOI; recursive = true)
@show a
@show b
println()
end
a = *(f::T, g::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1678
b = *(z::MutableArithmetics.Zero, ::Any) in MutableArithmetics at /Users/oscar/.julia/packages/MutableArithmetics/geMUn/src/rewrite.jl:53
a = operate(::typeof(+), ::Type{T}, f::MathOptInterface.ScalarAffineFunction{T}, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:127
b = operate(::typeof(+), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:174
a = *(f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, args::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T...) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1572
b = *(f::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1666
a = *(f::T, g::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1678
b = *(::ChainRulesCore.ZeroTangent, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:104
a = *(f::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1666
b = *(::Any, ::ChainRulesCore.NoTangent) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:65
a = get(model::MathOptInterface.ModelLike, attr::MathOptInterface.AbstractConstraintAttribute, bridge::MathOptInterface.Bridges.Constraint.AbstractFunctionConversionBridge) in MathOptInterface.Bridges.Constraint at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/Constraint/bridges/functionize.jl:17
b = get(model::MathOptInterface.ModelLike, ::MathOptInterface.CanonicalConstraintFunction, bridge::MathOptInterface.Bridges.AbstractBridge) in MathOptInterface.Bridges at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/bridge.jl:151
a = operate(::typeof(*), ::Type{T}, f::T, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:566
b = operate(::typeof(*), ::Type{T}, f::MathOptInterface.ScalarNonlinearFunction, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:593
a = operate(::typeof(*), ::Type{T}, f::T, g::MathOptInterface.VectorOfVariables) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:541
b = operate(::typeof(*), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorOfVariables, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:577
a = /(f::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1717
b = /(::Any, x::ChainRulesCore.NotImplemented) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_types/notimplemented.jl:43
a = promote_operation(::typeof(*), ::Type{T}, ::Type{T}, ::Type{MathOptInterface.VectorOfVariables}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/promote_operation.jl:214
b = promote_operation(::typeof(*), ::Type{T}, ::Type{MathOptInterface.VectorOfVariables}, ::Type{T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/promote_operation.jl:254
a = dot(f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1759
b = dot(α::T, func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1760
a = dot(func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, α::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1761
b = dot(::Any, ::ChainRulesCore.NoTangent) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:68
a = get(bridge::MathOptInterface.Bridges.Constraint._AbstractSlackBridge{T, VF, ZS, F, S} where S, ::MathOptInterface.ListOfConstraintIndices{F, ZS}) where {T, VF, ZS, F} in MathOptInterface.Bridges.Constraint at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/Constraint/bridges/slack.jl:35
b = get(bridge::MathOptInterface.Bridges.Constraint._AbstractSlackBridge{T, VF, ZS, F, S}, ::MathOptInterface.ListOfConstraintIndices{VF, S}) where {T, VF, ZS, F, S} in MathOptInterface.Bridges.Constraint at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/Constraint/bridges/slack.jl:42
a = promote_operation(::typeof(*), ::Type{T}, ::Type{T}, ::Type{MathOptInterface.VariableIndex}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/promote_operation.jl:205
b = promote_operation(::typeof(*), ::Type{T}, ::Type{MathOptInterface.VariableIndex}, ::Type{T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/promote_operation.jl:245
a = operate(::typeof(+), ::Type{T}, f::MathOptInterface.VariableIndex, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:102
b = operate(::typeof(+), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:174
a = dot(f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1759
b = dot(func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, α::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1761
a = _add_sub_affine_terms(op::Union{typeof(+), typeof(-)}, terms::Array{MathOptInterface.ScalarAffineTerm{T}, 1}, α::T, f::MathOptInterface.VariableIndex, β::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/mutable_arithmetics.jl:267
b = _add_sub_affine_terms(op::Union{typeof(+), typeof(-)}, terms::Array{MathOptInterface.ScalarAffineTerm{T}, 1}, α::T, β::T, args::Vararg{Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, T} where T, N}) where {T, N} in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/mutable_arithmetics.jl:361
a = dot(func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, α::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1761
b = dot(::Any, x::ChainRulesCore.NotImplemented) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:40
a = dot(α::T, func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1760
b = dot(::ChainRulesCore.ZeroTangent, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:107
a = _add_sub_affine_terms(op::Union{typeof(+), typeof(-)}, terms::Array{MathOptInterface.ScalarAffineTerm{T}, 1}, f::MathOptInterface.VariableIndex, β::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/mutable_arithmetics.jl:278
b = _add_sub_affine_terms(op::Union{typeof(+), typeof(-)}, terms::Array{MathOptInterface.ScalarAffineTerm{T}, 1}, α::T, f::MathOptInterface.VariableIndex) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/mutable_arithmetics.jl:288
a = dot(α::T, func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1760
b = dot(::ChainRulesCore.NoTangent, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:67
a = operate(::typeof(-), ::Type{T}, f::MathOptInterface.ScalarAffineFunction{T}, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:372
b = operate(::typeof(-), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:423
a = promote_rule(F::Type{MathOptInterface.ScalarQuadraticFunction{T}}, ::Type{T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:2274
b = promote_rule(F::Type{var"#s288"} where var"#s288"<:Union{MathOptInterface.ScalarAffineFunction, MathOptInterface.ScalarQuadraticFunction}, ::Type{MathOptInterface.VariableIndex}) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:2281
a = *(f::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1666
b = *(::Any, ::ChainRulesCore.ZeroTangent) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:105
a = *(f::T, g::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1678
b = *(::ChainRulesCore.NoTangent, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:64
a = promote_rule(F::Type{MathOptInterface.ScalarAffineFunction{T}}, ::Type{T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:2267
b = promote_rule(F::Type{var"#s288"} where var"#s288"<:Union{MathOptInterface.ScalarAffineFunction, MathOptInterface.ScalarQuadraticFunction}, ::Type{MathOptInterface.VariableIndex}) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:2281
a = *(f::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1666
b = *(::Any, x::ChainRulesCore.NotImplemented) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:38
a = *(f::T, g::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1678
b = *(x::ChainRulesCore.NotImplemented, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:37
a = get(::MathOptInterface.Bridges.Constraint._AbstractSlackBridge{T, VF, ZS, F, S} where S, ::MathOptInterface.NumberOfConstraints{F, ZS}) where {T, VF, ZS, F} in MathOptInterface.Bridges.Constraint at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/Constraint/bridges/slack.jl:21
b = get(::MathOptInterface.Bridges.Constraint._AbstractSlackBridge{T, VF, ZS, F, S}, ::MathOptInterface.NumberOfConstraints{VF, S}) where {T, VF, ZS, F, S} in MathOptInterface.Bridges.Constraint at /Users/oscar/.julia/dev/MathOptInterface/src/Bridges/Constraint/bridges/slack.jl:28
a = operate(::typeof(-), ::Type{T}, f::MathOptInterface.ScalarQuadraticFunction{T}, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:394
b = operate(::typeof(-), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:423
a = *(f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T, args::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}} where T...) in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1572
b = *(f::T, g::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1678
a = operate(::typeof(+), ::Type{T}, f::MathOptInterface.ScalarQuadraticFunction{T}, g::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, T}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:145
b = operate(::typeof(+), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:174
a = dot(func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}, α::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1761
b = dot(::Any, ::ChainRulesCore.ZeroTangent) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:108
a = dot(α::T, func::Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}, MathOptInterface.VectorAffineFunction{T}, MathOptInterface.VectorQuadraticFunction{T}}) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/functions.jl:1760
b = dot(x::ChainRulesCore.NotImplemented, ::Any) in ChainRulesCore at /Users/oscar/.julia/packages/ChainRulesCore/a4mIA/src/tangent_arithmetic.jl:39
a = operate(::typeof(-), ::Type{T}, f::MathOptInterface.VariableIndex, g::T) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:347
b = operate(::typeof(-), ::Type{T}, f::Union{MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarNonlinearFunction, MathOptInterface.ScalarQuadraticFunction{T}, T}, g::MathOptInterface.ScalarNonlinearFunction) where T in MathOptInterface.Utilities at /Users/oscar/.julia/dev/MathOptInterface/src/Utilities/operate.jl:423 |
I think it's find to assume |
}, | ||
) where {T} | ||
return g * f | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking, but only in the sense that it was never documented or expected to work. having functions with non-number coefficients is just asking for trouble.
It's also weird because this is the only case where we'd expect things to work. You can't do *(::NonNumber, ::VariableIndex)
@@ -1697,7 +1669,7 @@ function Base.:/( | |||
MOI.VectorQuadraticFunction{T}, | |||
}, | |||
g::T, | |||
) where {T} | |||
) where {T<:Number} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here. The method below assumes Number
, so these are really inconsistent and a bug fix.
@@ -641,7 +641,7 @@ function check_type_and_multiple_names( | |||
value::T, | |||
::Nothing, | |||
name, | |||
) where {T} | |||
) where {T<:MOI.Index} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non-breaking and just a pure fix.
I think I'm okay marking this as a bug-fix. We certainly never intended for MOI to work with non-number coefficients, and only a very small subset of methods would currently work. |
Updated solver-tests, now with JuMP extensions: https://github.com/jump-dev/MathOptInterface.jl/actions/runs/5395649560 |
@blegat I guess we should hold off on this until SumOfSquares and PolyJuMP are installable and passing tests? |
@blegat |
Yes, we can merge |
@odow I'd like to be able to replace the following logic (where
with a single "canonicalize" call, like e.g. |
Rebased and re-ran solver-tests: https://github.com/jump-dev/MathOptInterface.jl/actions/runs/5732403691 |
@chriscoey let's talk about this separately. You'd probably need to write something like that in your own package. I don't know if we want it in MOI. |
All solver-tests passing, so I think we're good to go. I'll wait for @blegat to take another look, since it has been a while. |
Closes #2222
solver-tests
: https://github.com/jump-dev/MathOptInterface.jl/actions/runs/5361630981