~esys/escript-finley/trunk

Viewing all changes in revision 5388.

  • Committer: aellery
  • Date: 2019-01-07 23:59:00 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:6769

I have rewritten the interpolation algorithm in the zoom function in minimizers.py. This new algorithm uses quadratic interpolation on the first step and cubic interpolation on subsequent steps. Unlike the prior version it does not require any additional function evaluations.

In case anybody is curious, the if statements in quadinterpolate and cubicinterpolate account for the following scenarios in which the algorithm could fail:
72: The user has passed alpha_lo and alpha_hi on the incorrect order
76: The user is approximating the derivative of the function phi using finite differences
80: The minimum of the interpolated quadratic is outside of the domain
85: The user has passed alpha_lo and alpha_hi in the incorrect order
87: Duplicate point (alpha_lo = 0 so that phi(alpha_lo) = phi(0))
95: The answer is going to be complex, which will cause PASO to break (this shouldn't happen unless the user does something silly. I have only included this for completeness)
99: It is possible that multiple roots lie in the domain. This finds the larger of the two that is less than alpha_hi.
100: The minimum of the interpolated cubic is outside of the domain
102: This is a safeguard to ensure that the new value of alpha is not too close to the last value and isn't too much smaller than the last value.



expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: