Skip to content

Commit

Permalink
240403.005552.HKT minor revision to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Apr 2, 2024
1 parent 93a97ca commit a31a960
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions fortran/lincoa/geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module geometry_lincoa_mod
!
! Started: February 2022
!
! Last Modified: Tuesday, March 12, 2024 PM09:57:55
! Last Modified: Wednesday, April 03, 2024 AM12:54:36
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -98,10 +98,10 @@ function setdrop_tr(idz, kopt, ximproved, bmat, d, delta, rho, xpt, zmat) result
! However, Powell's LINCOA code is different. In his code, the KNEW after a trust-region step is
! picked in lines 72--96 of the update.f for LINCOA, where DISTSQ is calculated as the square of the
! distance to XPT(KOPT, :) (Powell recorded the interpolation points in rows). However, note that
! the trust-region trial point has not been included into XPT yet --- it can not be included
! without knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code
! picks KNEW based on the distance to the un-updated "optimal point", which is unreasonable.
! This has been corrected in our implementation of LINCOA, yet it does not boost the performance.
! the trust-region trial point has not been included into XPT yet --- it cannot be included without
! knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code picks KNEW
! based on the distance to the un-updated "optimal point", which is unreasonable. This has been
! corrected in our implementation of LINCOA, yet it does not boost the performance.
if (ximproved) then
distsq = sum((xpt - spread(xpt(:, kopt) + d, dim=2, ncopies=npt))**2, dim=1)
!!MATLAB: distsq = sum((xpt - (xpt(:, kopt) + d)).^2) % d should be a column!! Implicit expansion
Expand Down
10 changes: 5 additions & 5 deletions fortran/newuoa/geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module geometry_newuoa_mod
!
! Started: July 2020
!
! Last Modified: Saturday, March 16, 2024 AM04:47:40
! Last Modified: Wednesday, April 03, 2024 AM12:55:24
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -100,10 +100,10 @@ function setdrop_tr(idz, kopt, ximproved, bmat, d, delta, rho, xpt, zmat) result
! However, Powell's LINCOA code is different. In his code, the KNEW after a trust-region step is
! picked in lines 72--96 of the update.f for LINCOA, where DISTSQ is calculated as the square of the
! distance to XPT(KOPT, :) (Powell recorded the interpolation points in rows). However, note that
! the trust-region trial point has not been included into XPT yet --- it can not be included
! without knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code
! picks KNEW based on the distance to the un-updated "optimal point", which is unreasonable.
! This has been corrected in our implementation of LINCOA, yet it does not boost the performance.
! the trust-region trial point has not been included into XPT yet --- it cannot be included without
! knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code picks KNEW
! based on the distance to the un-updated "optimal point", which is unreasonable. This has been
! corrected in our implementation of LINCOA, yet it does not boost the performance.
if (ximproved) then
distsq = sum((xpt - spread(xpt(:, kopt) + d, dim=2, ncopies=npt))**2, dim=1)
!!MATLAB: distsq = sum((xpt - (xpt(:, kopt) + d)).^2) % d should be a column! Implicit expansion
Expand Down
10 changes: 5 additions & 5 deletions fortran/uobyqa/geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module geometry_uobyqa_mod
!
! Started: February 2022
!
! Last Modified: Tuesday, March 12, 2024 PM09:57:17
! Last Modified: Wednesday, April 03, 2024 AM12:54:55
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -92,10 +92,10 @@ function setdrop_tr(kopt, ximproved, d, pl, rho, xpt) result(knew)
! However, Powell's LINCOA code is different. In his code, the KNEW after a trust-region step is
! picked in lines 72--96 of the update.f for LINCOA, where DISTSQ is calculated as the square of the
! distance to XPT(KOPT, :) (Powell recorded the interpolation points in rows). However, note that
! the trust-region trial point has not been included into XPT yet --- it can not be included
! without knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code
! picks KNEW based on the distance to the un-updated "optimal point", which is unreasonable.
! This has been corrected in our implementation of LINCOA, yet it does not boost the performance.
! the trust-region trial point has not been included into XPT yet --- it cannot be included without
! knowing KNEW (see lines 332-344 and 404--431 of lincob.f). Hence Powell's LINCOA code picks KNEW
! based on the distance to the un-updated "optimal point", which is unreasonable. This has been
! corrected in our implementation of LINCOA, yet it does not boost the performance.
if (ximproved) then
distsq = sum((xpt - spread(xpt(:, kopt) + d, dim=2, ncopies=npt))**2, dim=1)
!!MATLAB: distsq = sum((xpt - (xpt(:, kopt) + d)).^2) % d should be a column! Implicit expansion
Expand Down

0 comments on commit a31a960

Please sign in to comment.