JuMP.jl icon indicating copy to clipboard operation
JuMP.jl copied to clipboard

Improve matrix inequality support

Open odow opened this issue 1 year ago • 1 comments

Follow-up to #3766.

In our discussion of https://github.com/jump-dev/JuMP.jl/pull/3766, we never really talked about the fact that == is not ambiguous.

odow avatar Jun 25 '24 22:06 odow

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.40%. Comparing base (95da051) to head (4228d97).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3778   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files          44       44           
  Lines        5956     5966   +10     
=======================================
+ Hits         5861     5871   +10     
  Misses         95       95           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 25 '24 23:06 codecov[bot]

Can we just replace Nonnegatives here: https://github.com/jump-dev/JuMP.jl/blob/301d46e81cb66c74c6e22cd89fb89ced740f157b/src/macros/%40constraint.jl#L583 What are the other cases that you'd like to intercept ?

blegat avatar Jul 01 '24 07:07 blegat

I didn't do this, because it could be interpreted as a breaking change.

odow avatar Jul 13 '24 04:07 odow

Bump @blegat

odow avatar Jul 23 '24 02:07 odow

I didn't do this, because it could be interpreted as a breaking change.

Breaking change for which function ? We are changing it to _OpGreaterThan before giving it to build_constraint in this PR as well anyway.

blegat avatar Jul 30 '24 07:07 blegat

Changes the return of operator_to_set, but perhaps this is minor: https://juliahub.com/ui/Search?type=code&q=operator_to_set

odow avatar Jul 30 '24 07:07 odow

Indeed, the function could be used outside of a JuMP macro. I'd say it is minor. _intercept_operator is complicated or code too much just to accomplish to accomplish exactly the same thing as changing the returned value of operator_to_set

blegat avatar Jul 30 '24 08:07 blegat

I made a slight tweak to get rid of _intercept_operator but add a new method to operator_to_set.

odow avatar Jul 31 '24 00:07 odow

I still think this complicating things too much just for such a small breaking change. Users are expected to implement operator_to_set, we never said that calling it would always return the same thing. I can't believe we haven't made something that could qualify as breaking for the returned value of such function since JuMP v1.0

blegat avatar Jul 31 '24 07:07 blegat

Okay how about now

odow avatar Aug 01 '24 02:08 odow

I'd prefer to name things for what they are rather than what they are used for. What about calling the set Nonnegative and saying that @constraint(model, a - b in Nonnegative()) and @constraint(model, a >= b) are synonymous.

blegat avatar Aug 01 '24 08:08 blegat

Let's please not have Nonnegative and Nonnegatives for the same but slightly different thing.

odow avatar Aug 02 '24 00:08 odow

How about GreaterThanZero ?

blegat avatar Aug 02 '24 07:08 blegat

This needs something similar to https://github.com/jump-dev/JuMP.jl/pull/3797

odow avatar Aug 04 '24 02:08 odow

This needs something similar to #3797

What do you mean ?

blegat avatar Aug 05 '24 12:08 blegat

It needed the adjoint dual for the new constraints, which is why this PR is based against #3797

On Tue, 6 Aug 2024, 12:17 am Benoît Legat, @.***> wrote:

This needs something similar to #3797 https://github.com/jump-dev/JuMP.jl/pull/3797

What do you mean ?

— Reply to this email directly, view it on GitHub https://github.com/jump-dev/JuMP.jl/pull/3778#issuecomment-2268934419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6MQJJXGCZ54AZI6C6MI3DZP5UMHAVCNFSM6AAAAABJ4WXBR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYHEZTINBRHE . You are receiving this because you authored the thread.Message ID: @.***>

odow avatar Aug 05 '24 14:08 odow

Okay, this is good to go on my end.

odow avatar Aug 06 '24 04:08 odow