-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Make VariableInfo non-mutable #1569
Conversation
test/JuMPExtension.jl
Outdated
function JuMP.lower_bound(vref::MyVariableRef) | ||
@assert !JuMP.is_fixed(vref) | ||
vref.model.variables[vref.idx].info.lower_bound | ||
variable_info(vref).lower_bound |
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.
Nit: Missing return
test/JuMPExtension.jl
Outdated
function JuMP.upper_bound(vref::MyVariableRef) | ||
@assert !JuMP.is_fixed(vref) | ||
vref.model.variables[vref.idx].info.upper_bound | ||
variable_info(vref).upper_bound |
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.
Missing return
test/macros.jl
Outdated
JuMP.variable_type(m::Model, ::Type{MyVariable}) = MyVariable | ||
names = Dict{MyVariable, String}() | ||
function JuMP.add_variable(m::Model, v::MyVariable, name::String="") | ||
names[v] = name | ||
v | ||
end | ||
# Since `VariableInfo` is an un-mutable struct, two objects with the same |
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.
Nit: s/un-mutable/immutable/
Codecov Report
@@ Coverage Diff @@
## master #1569 +/- ##
======================================
Coverage 89.5% 89.5%
======================================
Files 27 27
Lines 3630 3630
======================================
Hits 3249 3249
Misses 381 381
Continue to review full report at Codecov.
|
Closes #1525