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

Make VariableInfo non-mutable #1569

Merged
merged 3 commits into from
Oct 28, 2018
Merged

Make VariableInfo non-mutable #1569

merged 3 commits into from
Oct 28, 2018

Conversation

blegat
Copy link
Member

@blegat blegat commented Oct 28, 2018

Closes #1525

function JuMP.lower_bound(vref::MyVariableRef)
@assert !JuMP.is_fixed(vref)
vref.model.variables[vref.idx].info.lower_bound
variable_info(vref).lower_bound
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Missing return

function JuMP.upper_bound(vref::MyVariableRef)
@assert !JuMP.is_fixed(vref)
vref.model.variables[vref.idx].info.upper_bound
variable_info(vref).upper_bound
Copy link
Member

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
Copy link
Member

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
Copy link

codecov bot commented Oct 28, 2018

Codecov Report

Merging #1569 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1569   +/-   ##
======================================
  Coverage    89.5%   89.5%           
======================================
  Files          27      27           
  Lines        3630    3630           
======================================
  Hits         3249    3249           
  Misses        381     381
Impacted Files Coverage Δ
src/variables.jl 93.33% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0922e96...5f78e34. Read the comment docs.

@blegat blegat merged commit 4277183 into master Oct 28, 2018
@blegat blegat deleted the bl/unmutablevarinfo branch December 12, 2018 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants