Skip to content

Commit

Permalink
240404.222837.HKT revise the thresholds for the closeness between x a…
Browse files Browse the repository at this point in the history
…nd xpt in newuob.f90 and uobyqb.f90
  • Loading branch information
zaikunzhang committed Apr 4, 2024
1 parent 8e6095d commit f3fd9c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .development
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: Thursday, April 04, 2024 PM09:32:11
! Last Modified: Thursday, April 04, 2024 PM10:26:06
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -306,7 +306,7 @@ subroutine newuob(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
distsq = [(sum((x - (xbase + xpt(:, k)))**2, dim=1), k=1, npt)] ! Implied do-loop
!!MATLAB: distsq = sum((x - (xbase + xpt))**2, 1) % Implicit expansion
k = int(minloc(distsq, dim=1), kind(k))
if (distsq(k) <= (1.0E-2 * rhoend)**2) then
if (distsq(k) <= (1.0E-3 * rhoend)**2) then
f = fval(k)
else
! Evaluate the objective function at X, taking care of possible Inf/NaN values.
Expand Down Expand Up @@ -553,7 +553,7 @@ subroutine newuob(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
distsq = [(sum((x - (xbase + xpt(:, k)))**2, dim=1), k=1, npt)] ! Implied do-loop
!!MATLAB: distsq = sum((x - (xbase + xpt))**2, 1) % Implicit expansion
k = int(minloc(distsq, dim=1), kind(k))
if (distsq(k) <= (1.0E-2 * rhoend)**2) then
if (distsq(k) <= (1.0E-3 * rhoend)**2) then
f = fval(k)
else
! Evaluate the objective function at X, taking care of possible Inf/NaN values.
Expand Down
6 changes: 3 additions & 3 deletions fortran/uobyqa/uobyqb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module uobyqb_mod
!
! Started: February 2022
!
! Last Modified: Thursday, April 04, 2024 PM10:07:42
! Last Modified: Thursday, April 04, 2024 PM10:25:46
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -309,7 +309,7 @@ subroutine uobyqb(calfun, iprint, maxfun, eta1, eta2, ftarget, gamma1, gamma2, r
distsq = [(sum((x - (xbase + xpt(:, k)))**2, dim=1), k=1, npt)] ! Implied do-loop
!!MATLAB: distsq = sum((x - (xbase + xpt))**2, 1) % Implicit expansion
k = int(minloc(distsq, dim=1), kind(k))
if (distsq(k) <= (1.0E-2 * rhoend)**2) then
if (distsq(k) <= (1.0E-3 * rhoend)**2) then
f = fval(k)
else
! Evaluate the objective function at X, taking care of possible Inf/NaN values.
Expand Down Expand Up @@ -473,7 +473,7 @@ subroutine uobyqb(calfun, iprint, maxfun, eta1, eta2, ftarget, gamma1, gamma2, r
distsq = [(sum((x - (xbase + xpt(:, k)))**2, dim=1), k=1, npt)] ! Implied do-loop
!!MATLAB: distsq = sum((x - (xbase + xpt))**2, 1) % Implicit expansion
k = int(minloc(distsq, dim=1), kind(k))
if (distsq(k) <= (1.0E-2 * rhoend)**2) then
if (distsq(k) <= (1.0E-3 * rhoend)**2) then
f = fval(k)
else
! Evaluate the objective function at X, taking care of possible Inf/NaN values.
Expand Down

0 comments on commit f3fd9c6

Please sign in to comment.