Skip to content

Commit

Permalink
240407.003429.HKT revise comment in newuob.f90 regarding the threshol…
Browse files Browse the repository at this point in the history
…d for shiftbase; correct test_nvfortran.yml
  • Loading branch information
zaikunzhang committed Apr 6, 2024
1 parent 5ca897c commit e9c6fd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test_nvfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ jobs:

- name: Revise bobyqa/trustregion.f90 to see why `xbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1` leads to a SIGFPE
shell: bash
if: ${{ matrix.solver == 'bobyqa' }}
run:
run: |
cd fortran/bobyqa || exit 42
$SEDI "s|xbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|write(*,*) 'su = ', su, 'xopt = ', xopt, 'gopt = ', gopt\nxbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|" trustregion.f90
$SEDI "s|xbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|write(*,*) '========> su = ', su, 'xopt = ', xopt, 'gopt = ', gopt\nxbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|" trustregion.f90
cat trustregion.f90
- name: Conduct the test
Expand Down
6 changes: 3 additions & 3 deletions fortran/newuoa/newuob.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module newuob_mod
!
! Started: July 2020
!
! Last Modified: Saturday, April 06, 2024 PM11:42:10
! Last Modified: Sunday, April 07, 2024 AM12:31:14
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -626,8 +626,8 @@ subroutine newuob(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
! Powell's original criteria for shifting XBASE is as follows.
! 1. After a trust region step that is not short, shift XBASE if SUM(XOPT**2) >= 1.0E3*DNORM**2.
! 2. Before a geometry step, shift XBASE if SUM(XOPT**2) >= 1.0E3*DELBAR**2.
! 1.0E2 works better than 1.0E3 on 20230227.
! 1.0E2 works better than 5.0E2 on 20240406, especially if RP = REAL32.
! 3. 1.0E2 works better than 1.0E3 on 20230227. In addition, 1.0E2 works better than 2.0E2,
! 5.0E2, and 1.0E3 on 20240406, especially if RP = REAL32.
if (sum(xpt(:, kopt)**2) >= 1.0E2_RP * delta**2) then
call shiftbase(kopt, xbase, xpt, zmat, bmat, pq, hq, idz)
end if
Expand Down

0 comments on commit e9c6fd8

Please sign in to comment.