-
Notifications
You must be signed in to change notification settings - Fork 94
Fix PowerCone in MatrixOfConstraints #1722
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -413,16 +413,19 @@ function _load_constants( | |
set::MOI.AbstractScalarSet, | ||
) | ||
MOI.throw_if_scalar_and_constant_not_zero(func, typeof(set)) | ||
return load_constants(constants, offset, set) | ||
load_constants(constants, offset, set) | ||
return | ||
end | ||
|
||
function _load_constants( | ||
constants, | ||
offset, | ||
func::MOI.AbstractVectorFunction, | ||
::MOI.AbstractVectorSet, | ||
set::MOI.AbstractVectorSet, | ||
) | ||
return load_constants(constants, offset, func) | ||
load_constants(constants, offset, func) | ||
load_constants(constants, offset, set) | ||
return | ||
end | ||
|
||
function _load_constraints( | ||
|
@@ -523,6 +526,19 @@ function load_constants( | |
return | ||
end | ||
|
||
load_constants(::Vector, ::Any, ::MOI.AbstractVectorSet) = nothing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would probably be safer to be opt-in rather than opt-out here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's breaking. And it's a bit of a pain to have to enumerate everything. Really, the failing tests in SCS should have picked this up earlier. But I obviously excluded them during development and didn't revisit them :( |
||
|
||
function load_constants( | ||
::Vector, | ||
::Any, | ||
S::Union{MOI.PowerCone,MOI.DualPowerCone}, | ||
) | ||
return error( | ||
"`$(typeof(S))` cannot be used with `Vector` as the set type in " * | ||
"MatrixOfConstraints", | ||
) | ||
end | ||
|
||
function_constants(b::Vector, rows) = b[rows] | ||
|
||
""" | ||
|
Uh oh!
There was an error while loading. Please reload this page.