-
Notifications
You must be signed in to change notification settings - Fork 9
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
added linear Oettli-Präger solver #44
Conversation
Codecov Report
@@ Coverage Diff @@
## main #44 +/- ##
==========================================
- Coverage 95.98% 91.37% -4.61%
==========================================
Files 8 9 +1
Lines 224 255 +31
==========================================
+ Hits 215 233 +18
- Misses 9 22 +13
Continue to review full report at Codecov.
|
would it be better to return an array of polyhedra or one UnionSet? |
|
be sure to be using LazySets#v1.41.2 |
09e2509
to
b8694e2
Compare
|
|
no, it was added in release v1.47.2 |
@@ -9,8 +9,9 @@ function (opl::LinearOettliPrager)(A, b) | |||
Ar = IntervalArithmetic.radius.(A) | |||
br = IntervalArithmetic.radius.(b) | |||
|
|||
orthants = list_orthants(length(b)) | |||
polytopes = Vector{HPolytope}(undef, length(orthants)) | |||
polytopes = Vector{HPolytope}(undef, 2^n) |
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.
this could give unexpected errors. try 2^50
and Julia gives ERROR: OutOfMemoryError()
. try 2^100
and it returns an empty array, since it overflows.
should we print an error message if n
is too big to handle with this method?
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.
yeah it could be good I guess. An improved version of this solver could allow the user to cherry pick the orthants they want to go through (e.g. some quantities are constrained to be positive, have computed an enclosure and crossed out some orthants). I wonder what would be a user friendly interface to index the orthants
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.
I left some minor comments.
[1.0, -1.0] | ||
``` | ||
""" | ||
function list_orthants(n) |
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.
this function is no longer used; it could be removed.
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.
it may still be useful to have a function that goes through all orthants here, especially since lazy sets is an optional dependency. But there's definitely room for improvement in the current version
This algorithm converts the nonlinear system of real inequalities obtained with Oettli-Präger theorem to
2^n
systems of linear real inequalities (one for each orthant) which are then solved usingLazySets.jl