Skip to content
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

comparison operators to create Constraints from Values? #31

Open
exaexa opened this issue Jan 29, 2024 · 3 comments
Open

comparison operators to create Constraints from Values? #31

exaexa opened this issue Jan 29, 2024 · 3 comments

Comments

@exaexa
Copy link
Member

exaexa commented Jan 29, 2024

this could work:

sometree.someconstraint.value >=0

equal to say

C.Constraint(sometree.someconstraint.value, C.Between(0, Inf))

or so.

@exaexa exaexa added this to the finalize to 1.0 milestone Jan 29, 2024
@stelmo
Copy link
Member

stelmo commented Jan 30, 2024

what about

sometree.someconstraint.value == 0

same as

C.Constraint(sometree.someconstraint.value, C.EqualTo(0))

Lol, basically JuMP syntax, but without the macros

@exaexa exaexa removed this from the finalize to 1.0 milestone Apr 16, 2024
@exaexa
Copy link
Member Author

exaexa commented Apr 16, 2024

OK after re-reading the docs (like here: https://cobrexa.github.io/ConstraintTrees.jl/v1.0/0-quickstart/#Combining-constraint-systems:-Let's-have-a-factory%21 ) I guess this should be given priority. The constraints in the snippets there are not nice at all. :D

@exaexa exaexa added this to the v1.1 milestone Apr 16, 2024
@exaexa exaexa modified the milestones: v1.1, v1.2 Jun 6, 2024
@exaexa exaexa removed this from the v1.2 milestone Jun 19, 2024
@exaexa
Copy link
Member Author

exaexa commented Jul 25, 2024

extra take: == should return Bool to prevent absolute type madness; maybe C.equal_constraint(x, y) ?

EDIT: might be useful to just backport some of the simple constraint building stuff from COBREXA. After thinking a bit I'm not sure if having the operators is a good idea at all (Julia can't typecheck the result types very easily so in the end we might have one huge source of hidden bugs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants