Skip to content

Improve quadratic support in MOIU #481

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

Merged
merged 6 commits into from
Aug 23, 2018
Merged

Improve quadratic support in MOIU #481

merged 6 commits into from
Aug 23, 2018

Conversation

blegat
Copy link
Member

@blegat blegat commented Aug 21, 2018

This PR contains changes in MOIU of #478. They shouldn't be blocked by the SOCtoQuad bridge

@codecov-io
Copy link

codecov-io commented Aug 21, 2018

Codecov Report

Merging #481 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #481      +/-   ##
==========================================
+ Coverage   95.32%   95.38%   +0.06%     
==========================================
  Files          46       46              
  Lines        4640     4681      +41     
==========================================
+ Hits         4423     4465      +42     
+ Misses        217      216       -1
Impacted Files Coverage Δ
src/Bridges/squarepsdbridge.jl 96.66% <ø> (ø) ⬆️
src/Bridges/geomeanbridge.jl 100% <ø> (ø) ⬆️
src/Bridges/detbridge.jl 98.76% <100%> (ø) ⬆️
src/Utilities/constraints.jl 100% <100%> (ø) ⬆️
src/functions.jl 100% <100%> (ø) ⬆️
src/Utilities/functions.jl 96.88% <100%> (+0.68%) ⬆️

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 19d85b0...e0a8287. Read the comment docs.

scalar_term = MOI.ScalarAffineTerm(coefficient, t1.scalar_term.variable_index)
return MOI.VectorAffineTerm(t1.output_index, scalar_term)
function unsafe_add(t1::MOI.ScalarQuadraticTerm, t2::MOI.ScalarQuadraticTerm)
return MOI.ScalarAffineTerm(t1.coefficient + t2.coefficient,
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? The docstring says it returns a ScalarQuadraticTerm.

src/functions.jl Outdated
coefficient(t::Union{ScalarAffineTerm, ScalarQuadraticTerm
VectorAffineTerm, VectorQuadraticTerm})

Finds the coefficient associated with the term `t`.
Copy link
Member

Choose a reason for hiding this comment

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

"associated with" implies lookup in a container. It's clearer to say "stored in".

add_scalar_constraint(model::MOI.ModelLike,
func::MOI.AbstractScalarFunction,
set::MOI.AbstractScalarSet;
own_function::Bool=false)
Copy link
Member

Choose a reason for hiding this comment

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

When reading this without the documentation it's not clear if own_function means that the caller owns the function or that add_scalar_constraint takes ownership of the function. What about allow_modify_function?

@blegat blegat merged commit c55e167 into master Aug 23, 2018
@blegat blegat deleted the bl/quad branch August 28, 2018 14:32
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.

3 participants