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

DiffOpt accepts SingleVariable in ScalarSet but does not retrieve it #67

Closed
matbesancon opened this issue Jan 31, 2021 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@matbesancon
Copy link
Collaborator

This is due to get_problem_data(model::MOI.AbstractOptimizer) fetching only ScalarAffineFunction in set, so SingleVariable is passed but not counted

@matbesancon matbesancon added the bug Something isn't working label Jan 31, 2021
@matbesancon
Copy link
Collaborator Author

Handling single variables is tricky, one part of the issue is that we don't check lower bounds here:

ERROR: MathOptInterface.LowerBoundAlreadySet{MathOptInterface.GreaterThan{Float64}, MathOptInterface.GreaterThan{Float64}}: Cannot add `SingleVariable`-in`MathOptInterface.GreaterThan{Float64}` constraint for variable MathOptInterface.VariableIndex(3) as a `SingleVariable`-in`MathOptInterface.GreaterThan{Float64}` constraint was already set for this variable and both constraints set a lower bound.

is thrown in certain cases, but not all.

@matbesancon
Copy link
Collaborator Author

There seems to be a more general issue that not all constraints are retrieved, only SAF in LessThan which ignores for example vectorized Ax + b = 0, has this been looked at? @Aks1996 @blegat

@matbesancon
Copy link
Collaborator Author

Currently we offer blanket support for some sets and functions which should probably not be there:

const SUPPORTED_SCALAR_SETS = Union{
    MOI.GreaterThan{Float64},
    MOI.LessThan{Float64},
    MOI.EqualTo{Float64},
    MOI.Interval{Float64}
}

const SUPPORTED_SCALAR_FUNCTIONS = Union{
    MOI.SingleVariable,
    MOI.ScalarAffineFunction{Float64}
}

const SUPPORTED_VECTOR_FUNCTIONS = Union{
    MOI.VectorOfVariables,
    MOI.VectorAffineFunction{Float64},
}

const SUPPORTED_VECTOR_SETS = Union{
    MOI.Zeros,
    MOI.Nonpositives,
    MOI.Nonnegatives,
    MOI.SecondOrderCone,
    MOI.PositiveSemidefiniteConeTriangle,
}

@akshay326
Copy link
Collaborator

There seems to be a more general issue that not all constraints are retrieved, only SAF in LessThan which ignores for example vectorized Ax + b = 0, has this been looked at? @Aks1996 @blegat

nope. get_problem_data isn't extracting all constraints - such as greater than con. this issue links to #14 , which i totally forgot

@matbesancon
Copy link
Collaborator Author

@be-apt I think this one can be closed?

@akshay326
Copy link
Collaborator

yep, was fixed in #77. Diffopt retrieves SingleVariable in <, > constraints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants