add relative tolerance to BranchAndBoundEnclosure - #179
Conversation
schillic
left a comment
There was a problem hiding this comment.
Thanks for the proposal. I do not fully understand. Can you give an example?
|
Basically, this PR makes it possible to run Currently, |
|
Okay, makes sense now. Some comments:
@mforets, @lucaferranti, what do you think? |
| fX = f(X) # TODO: allow user to choose how to evaluate this (mean value, natural enclosure) | ||
| # if tolerance or maximum number of iteration is met, return current enclosure | ||
| if diam(fX) <= bab.tol || cnt == bab.maxdepth | ||
| min_abs = in_interval(0, fX) ? zero(fX.lo) : min(abs(fX.lo), abs(fX.hi)) |
There was a problem hiding this comment.
This is the definition of mignitude
| min_abs = in_interval(0, fX) ? zero(fX.lo) : min(abs(fX.lo), abs(fX.hi)) | |
| min_abs = mig(fX) |
There was a problem hiding this comment.
Nice. Then I suggest to inline the function instead of having this extra line.
|
I dont think we need an alias, let's just rename |
Thanks for the package, it's already very useful and convenient!
Here, I suggest to add an
rtolargument, so that one can easily specify the target tolerance independent on the scale of values in a problem.If this addition is welcome, we can discuss the best way to backwards compatibility: either keep
toland not rename it toatol, or add atolalias foratol.