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

Ar/quad coefficients #213

Merged
merged 2 commits into from
Apr 20, 2022
Merged

Conversation

AlexRobson
Copy link
Contributor

Closes #211

test/jump.jl Outdated
grad_constraint = JuMP.constant(MOI.get(model, DiffOpt.BackwardOutConstraint(), ctr_le[]))
@test grad_constraint ≈ -1.0 atol=ATOL rtol=RTOL

# Test some overloads. Better place elsewhere?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put these here as there isn't a jump.jl test file - arguably that could be created

@@ -1,7 +1,7 @@
name = "DiffOpt"
uuid = "930fe3bc-9c6b-11ea-2d94-6184641e85e7"
authors = ["Akshay Sharma", "Mathieu Besançon", "Joaquim Dias Garcia", "Benoît Legat"]
version = "0.3.1"
version = "0.3.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bugfix

@@ -240,12 +240,12 @@ function JuMP.coefficient(func::MOItoJuMP, var_ref::JuMP.VariableRef)
return JuMP.coefficient(func.func, JuMP.index(var_ref))
end
function quad_sym_half(func::MOItoJuMP, var1_ref::JuMP.VariableRef, var2_ref::JuMP.VariableRef)
check_belongs_to_model(var1_ref, func.model)
return quad_sym_half(func.func, JuMP.index(vi1), JuMP.index(var2_ref))
check_belongs_to_model.([var1_ref, var2_ref], Ref(func.model))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

technically this change isn't being tested, but this would just test a function in JuMP so fine?

@AlexRobson AlexRobson force-pushed the ar/quad_coefficients branch from f7e5c57 to 5cf665b Compare April 20, 2022 10:24
@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #213 (2bdbf8c) into master (57f01d1) will increase coverage by 1.81%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
+ Coverage   89.39%   91.21%   +1.81%     
==========================================
  Files           8        8              
  Lines         839      842       +3     
==========================================
+ Hits          750      768      +18     
+ Misses         89       74      -15     
Impacted Files Coverage Δ
src/diff_opt.jl 99.21% <ø> (ø)
src/jump_moi_overloads.jl 79.81% <100.00%> (+13.76%) ⬆️
src/moi_wrapper.jl 85.39% <0.00%> (+0.16%) ⬆️

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 aa7e827...2bdbf8c. Read the comment docs.

@matbesancon matbesancon merged commit db871ea into jump-dev:master Apr 20, 2022
@matbesancon
Copy link
Collaborator

Thanks!

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.

quad_sym_half and JuMP.coefficient for quadratic coefficients ERROR: UndefVarError: vi1 not defined
2 participants