Skip to content

Commit

Permalink
240226.232755.HKT fortran: correct maxiter in bobyqa/rescue.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Feb 26, 2024
1 parent 275e537 commit 3932598
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .development
4 changes: 2 additions & 2 deletions fortran/bobyqa/rescue.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module rescue_mod
!
! Started: February 2022
!
! Last Modified: Monday, February 26, 2024 PM10:22:58
! Last Modified: Monday, February 26, 2024 PM11:23:34
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -325,7 +325,7 @@ subroutine rescue(calfun, solver, iprint, maxfun, delta, ftarget, xl, xu, kopt,
! Originally, it is a WHILE loop, but we change it to a DO loop to avoid infinite cycling.
! N.B.: Overflow will occur in NPT^2 if NPT > 180 and IK = 16. The following is a workaround, which
! is **not needed in Python/MATLAB/Julia/R. In MATLAB, we can just take maxiter = npt^2**.
maxiter = int(min(10**range(0_IK), int(npt)**2), IK) !!MATLAB: maxiter = npt^2;
maxiter = int(min(10**min(range(0), range(0_IK)), int(npt)**2), IK) !!MATLAB: maxiter = npt^2;
do iter = 1, maxiter
! !DO WHILE (ANY(SCORE > 0) .AND. NPROV > 1) ! WHILE version.
! !IF (ALL(SCORE <= 0) .AND. NPROV <= 0) THEN ! Powell's code. May not take any provisional point.
Expand Down

0 comments on commit 3932598

Please sign in to comment.