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

Test more exotic cases #202

Closed
blegat opened this issue Mar 18, 2022 · 1 comment
Closed

Test more exotic cases #202

blegat opened this issue Mar 18, 2022 · 1 comment

Comments

@blegat
Copy link
Member

blegat commented Mar 18, 2022

Currently, we only test giving QPs in standard form and use QPDiff or giving CPs in standard for and use ConicDiff.
The user might not give these form and get errors as it's not tested.
We should add tests for this, e.g., adding a constraint in NormOneCone or NormInfinityCone to QPDiff (as it can be rewritten as LP).
This might encouter missing setters and getters for the DiffOpt attributes for a few bridges that we should add. Similar to

function MOI.set(
model::MOI.ModelLike,
attr::ForwardInConstraint,
bridge::MOI.Bridges.Constraint.VectorizeBridge{T},
value,
) where {T}
MOI.set(model, attr, bridge.vector_constraint, MOI.Utilities.operate(vcat, T, value))
end
function MOI.get(
model::MOI.ModelLike,
attr::DiffOpt.BackwardOutConstraint,
bridge::MOI.Bridges.Constraint.AbstractFunctionConversionBridge,
)
return MOI.get(model, attr, bridge.constraint)
end
function MOI.set(
model::MOI.ModelLike,
attr::DiffOpt.ForwardInConstraint,
bridge::MOI.Bridges.Constraint.SetMapBridge,
func,
)
mapped_func = MOI.Bridges.map_function(typeof(bridge), func)
MOI.set(model, attr, bridge.constraint, mapped_func)
end
function MOI.get(
model::MOI.ModelLike,
attr::DiffOpt.BackwardOutConstraint,
bridge::MOI.Bridges.Constraint.SetMapBridge,
)
func = MOI.get(model, attr, bridge.constraint)
return MOI.Bridges.adjoint_map_function(typeof(bridge), func)
end

@odow
Copy link
Member

odow commented Apr 12, 2023

Closing in favor of #102

@odow odow closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants