Compute the next step.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nlesolver_type), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in), | dimension(me%n) | :: | xold |
initial |
|
| real(kind=wp), | intent(in), | dimension(me%n) | :: | search_direction |
search direction vector |
|
| real(kind=wp), | intent(in) | :: | alpha |
step length to take in the search direction |
||
| logical, | intent(in), | dimension(me%n) | :: | modified |
indicates the elements of |
|
| real(kind=wp), | intent(out), | dimension(me%n) | :: | xnew |
final |
subroutine compute_next_step(me, xold, search_direction, alpha, modified, xnew) class(nlesolver_type),intent(inout) :: me real(wp),dimension(me%n),intent(in) :: xold !! initial `x` real(wp),dimension(me%n),intent(in) :: search_direction !! search direction vector real(wp),intent(in) :: alpha !! step length to take in the search direction logical,dimension(me%n),intent(in) :: modified !! indicates the elements of `p` that were !! modified because they violated the bounds. !! Output of [[adjust_search_direction]]. real(wp),dimension(me%n),intent(out) :: xnew !! final `x` if (me%bounds_mode == NLESOLVER_WALL_BOUNDS) then ! for the 'wall' mode, the modified variables are held fixed during the step where (modified) xnew = xold else where xnew = xold + search_direction * alpha end where else ! all other modes just use the computed search direction xnew = xold + search_direction * alpha end if end subroutine compute_next_step