-
Notifications
You must be signed in to change notification settings - Fork 92
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
src/Utilities/functions.jl
Outdated
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, |
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.
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`. |
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.
"associated with" implies lookup in a container. It's clearer to say "stored in".
src/Utilities/constraints.jl
Outdated
add_scalar_constraint(model::MOI.ModelLike, | ||
func::MOI.AbstractScalarFunction, | ||
set::MOI.AbstractScalarSet; | ||
own_function::Bool=false) |
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.
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
?
This PR contains changes in MOIU of #478. They shouldn't be blocked by the SOCtoQuad bridge