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

✨ Add support for vector of quadratic constraints #1677

Merged
merged 6 commits into from Dec 14, 2018
Merged

Conversation

blegat
Copy link
Member

@blegat blegat commented Dec 13, 2018

Closes #1644

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #1677 into master will increase coverage by 0.01%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1677      +/-   ##
==========================================
+ Coverage   67.94%   67.95%   +0.01%     
==========================================
  Files          30       30              
  Lines        3809     3829      +20     
==========================================
+ Hits         2588     2602      +14     
- Misses       1221     1227       +6
Impacted Files Coverage Δ
src/aff_expr.jl 71.81% <ø> (ø) ⬆️
src/quad_expr.jl 70.75% <71.42%> (-0.18%) ⬇️

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 fd64e3f...3bb1867. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #1677 into master will increase coverage by 2.24%.
The diff coverage is 73.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1677      +/-   ##
==========================================
+ Coverage   67.94%   70.18%   +2.24%     
==========================================
  Files          30       30              
  Lines        3809     4196     +387     
==========================================
+ Hits         2588     2945     +357     
- Misses       1221     1251      +30
Impacted Files Coverage Δ
src/aff_expr.jl 71.81% <100%> (ø) ⬆️
src/quad_expr.jl 70.75% <71.42%> (-0.18%) ⬇️
src/Containers/DenseAxisArray.jl 60.43% <0%> (+0.79%) ⬆️
src/Containers/SparseAxisArray.jl 67.61% <0%> (+2.68%) ⬆️
src/variables.jl 86.81% <0%> (+4.5%) ⬆️
src/macros.jl 88.05% <0%> (+4.75%) ⬆️

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 fd64e3f...c9e9335. Read the comment docs.

@blegat blegat added this to the 0.19 milestone Dec 13, 2018
Return the MOI.ScalarQuadraticTerm for the quadratic term `t`, element of the
[`quadterms`](@ref) iterator.
"""
function moi_quadratic_term(t::Tuple)
Copy link
Member

Choose a reason for hiding this comment

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

Add a note that model information is lost.


"""
_fillvqf!(terms, offset::Int, oi::Int, quad::AbstractJuMPScalar)

Copy link
Member

Choose a reason for hiding this comment

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

Naming: underscore between fill and vqf.

src/quad_expr.jl Outdated
moi_quadratic_term(term))
i += 1
end
offset + length(quadterms(aff))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: explicit return

src/quad_expr.jl Outdated
_fillvqf!(terms, offset::Int, oi::Int, quad::AbstractJuMPScalar)

Fills the vectors terms at indices starting at `offset+1` with the quadratic
terms of `quad`. The output index for all terms is `oi`.
Copy link
Member

Choose a reason for hiding this comment

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

The docstring doesn't mention the return value.

"""
_fillvqf!(terms, offset::Int, oi::Int, quad::AbstractJuMPScalar)

Fills the vectors terms at indices starting at `offset+1` with the quadratic
Copy link
Member

Choose a reason for hiding this comment

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

This documentation can't be understood on its own. What is the vector terms? (A type would help.)

@blegat blegat merged commit 5df6bbb into master Dec 14, 2018
@odow odow deleted the bl/vecquad branch December 30, 2018 17:02
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.

None yet

2 participants