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
Add constraint by name #1701
Add constraint by name #1701
Conversation
src/constraints.jl
Outdated
""" | ||
set_name(v::ConstraintRef, s::AbstractString) | ||
|
||
Set a constraint's name. |
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.
Name attribute
src/constraints.jl
Outdated
name::String)::Union{ConstraintRef, Nothing} | ||
|
||
Returns the reference of the constraint with name attribute `name` or `Nothing` | ||
if no constraint have this name attribute. Throws an error if several |
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.
typo: have -> has
@odow Could you check that the text of how we refer to name attributes is consistent with the rest of the documentation? |
src/constraints.jl
Outdated
|
||
Returns the reference of the constraint with name attribute `name` or `Nothing` | ||
if no constraint have this name attribute. Throws an error if several | ||
constraints have `name` as name attribute. |
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.
as their name attribute.
src/constraints.jl
Outdated
MOI.AbstactFunction}}, | ||
S::Type{<:MOI.AbstractSet})::Union{ConstraintRef, Nothing} | ||
|
||
Same as method above except that it throws an error if the constraint is not an |
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.
Similar to the method above, except that
src/constraints.jl
Outdated
S::Type{<:MOI.AbstractSet})::Union{ConstraintRef, Nothing} | ||
|
||
Same as method above except that it throws an error if the constraint is not an | ||
`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function |
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.
of the function,
src/constraints.jl
Outdated
Same as method above except that it throws an error if the constraint is not an | ||
`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function | ||
and `S` is either the JuMP or MOI type of the set. This method is recommended | ||
if you know the typeof the function and set as its returned type can be |
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.
the type of the
and set since its returned type
src/constraints.jl
Outdated
`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function | ||
and `S` is either the JuMP or MOI type of the set. This method is recommended | ||
if you know the typeof the function and set as its returned type can be | ||
inferred while for the method above, the exact return type of the constraint |
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.
inferred. For the method above (i.e. without F
and S
), the exact
docs/src/constraints.md
Outdated
name(::JuMP.ConstraintRef{Model, <:JuMP.MOI.ConstraintIndex}) | ||
set_name(::JuMP.ConstraintRef{Model, <:JuMP.MOI.ConstraintIndex}, ::String) | ||
``` | ||
. |
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.
Delete this
Codecov Report
@@ Coverage Diff @@
## master #1701 +/- ##
==========================================
+ Coverage 68.52% 68.55% +0.02%
==========================================
Files 30 30
Lines 3867 3880 +13
==========================================
+ Hits 2650 2660 +10
- Misses 1217 1220 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1701 +/- ##
==========================================
+ Coverage 68.52% 68.59% +0.06%
==========================================
Files 30 30
Lines 3867 3885 +18
==========================================
+ Hits 2650 2665 +15
- Misses 1217 1220 +3
Continue to review full report at Codecov.
|
Closes #1184