Skip to content

Commit

Permalink
231221.163129.HKT fix the call of callback_fcn regarding the type of …
Browse files Browse the repository at this point in the history
…`tr`
  • Loading branch information
zaikunzhang committed Dec 21, 2023
1 parent 8ce9aae commit 7171cd6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions fortran/bobyqa/bobyqb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module bobyqb_mod
!
! Started: February 2022
!
! Last Modified: Friday, November 03, 2023 PM02:57:45
! Last Modified: Thursday, December 21, 2023 PM02:26:49
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -221,11 +221,11 @@ subroutine bobyqb(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
! Report the current best value, and check if user asks for early termination.
terminate = .false.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0, terminate=terminate)
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0_IK, terminate=terminate)
if (terminate) then
subinfo = CALLBACK_TERMINATE
end if
endif
end if

! Initialize X and F according to KOPT.
x = xinbd(xbase, xpt(:, kopt), xl, xu, sl, su) ! In precise arithmetic, X = XBASE + XOPT.
Expand Down Expand Up @@ -582,16 +582,16 @@ subroutine bobyqb(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
call shiftbase(kopt, xbase, xpt, zmat, bmat, pq, hq)
xbase = max(xl, min(xu, xbase))
end if

! Report the current best value, and check if user asks for early termination.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, tr, terminate=terminate)
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, tr, terminate=terminate)
if (terminate) then
info = CALLBACK_TERMINATE
exit
end if
end if

end do ! End of DO TR = 1, MAXTR. The iterative procedure ends.

! Return from the calculation, after trying the Newton-Raphson step if it has not been tried yet.
Expand Down
6 changes: 3 additions & 3 deletions fortran/cobyla/cobylb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module cobylb_mod
!
! Started: July 2021
!
! Last Modified: Monday, October 16, 2023 AM01:15:52
! Last Modified: Thursday, December 21, 2023 PM02:57:27
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -218,7 +218,7 @@ subroutine cobylb(calcfc, iprint, maxfilt, maxfun, amat, bvec, ctol, cweight, et
! Report the current best value, and check if user asks for early termination.
terminate = .false.
if (present(callback_fcn)) then
call callback_fcn(sim(:, n+1), fval(n+1), nf, 0, cval(n+1), conmat(m_lcon+1:m, n+1), terminate)
call callback_fcn(sim(:, n + 1), fval(n + 1), nf, 0_IK, cval(n + 1), conmat(m_lcon + 1:m, n + 1), terminate)
if (terminate) then
subinfo = CALLBACK_TERMINATE
end if
Expand Down Expand Up @@ -605,7 +605,7 @@ subroutine cobylb(calcfc, iprint, maxfilt, maxfun, amat, bvec, ctol, cweight, et

! Report the current best value, and check if user asks for early termination.
if (present(callback_fcn)) then
call callback_fcn(sim(:, n+1), fval(n+1), nf, tr, cval(n+1), conmat(m_lcon+1:m, n+1), terminate)
call callback_fcn(sim(:, n + 1), fval(n + 1), nf, tr, cval(n + 1), conmat(m_lcon + 1:m, n + 1), terminate)
if (terminate) then
info = CALLBACK_TERMINATE
exit
Expand Down
6 changes: 3 additions & 3 deletions fortran/lincoa/lincob.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module lincob_mod
!
! Started: February 2022
!
! Last Modified: Friday, November 03, 2023 PM02:57:32
! Last Modified: Thursday, December 21, 2023 PM03:03:55
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -258,7 +258,7 @@ subroutine lincob(calfun, iprint, maxfilt, maxfun, npt, Aeq, Aineq, amat, beq, b
! Report the current best value, and check if user asks for early termination.
terminate = .false.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0, cval(kopt), terminate=terminate)
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0_IK, cval(kopt), terminate=terminate)
if (terminate) then
subinfo = CALLBACK_TERMINATE
end if
Expand Down Expand Up @@ -646,7 +646,7 @@ subroutine lincob(calfun, iprint, maxfilt, maxfun, npt, Aeq, Aineq, amat, beq, b
pqalt = omega_mul(idz, zmat, fval - fval(kopt))
galt = matprod(bmat(:, 1:npt), fval - fval(kopt)) + hess_mul(xpt(:, kopt), xpt, pqalt)
end if

! Report the current best value, and check if user asks for early termination.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, tr, cval(kopt), terminate=terminate)
Expand Down
4 changes: 2 additions & 2 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: Monday, November 06, 2023 PM07:46:24
! Last Modified: Thursday, December 21, 2023 PM03:05:39
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -180,7 +180,7 @@ subroutine newuob(calfun, iprint, maxfun, npt, eta1, eta2, ftarget, gamma1, gamm
! Report the current best value, and check if user asks for early termination.
terminate = .false.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0, terminate=terminate)
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0_IK, terminate=terminate)
if (terminate) then
subinfo = CALLBACK_TERMINATE
end if
Expand Down
2 changes: 1 addition & 1 deletion fortran/tests/tools/flint
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ for COMP in $COMP_LIST; do
printf "%s\t" "$FLG"
export FFLAGS=$FLG
INFO="$(make "$COMP"test_"$TEST"_tst_c."$SOLVER" 2>&1 \
| grep -v "binary\ file\ matches" \
| grep -v "binary\ file\ matches\|info,\ callback_fcn" \
| grep -i "starts\|warning\|error\|info\|abort\|invalid\|violation\|fault\|illegal\|fail\|questionable\|remark\|attention\|Could\ not\ resolve\|not\ defined\|not\ public\ entity" \
| grep -vi "[0-9]\s*warning\|[0-9]\s*error\|[0-9]\s*info\|infos.f90\|information\|xhist, info)\|zmat, info)\|--warning\|--error" \
| grep -vi "pedantic-errors\|Werror\|warn\ errors\|diag-error-limit\|colour=error\|rounding\ error\|constraint violation\|default" \
Expand Down
2 changes: 1 addition & 1 deletion fortran/tests/tools/mlint
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ for COMP in $COMP_LIST; do
printf "%s\t" "$FLG"
export FFLAGS=$FLG
INFO="$(make "$COMP"test_"$TEST"_tst."$SOLVER" 2>&1 \
| grep -v "binary\ file\ matches" \
| grep -v "binary\ file\ matches\|info,\ callback_fcn" \
| grep -i "starts\|warning\|error\|info\|abort\|invalid\|violation\|fault\|illegal\|fail\|questionable\|remark\|attention\|Could\ not\ resolve" \
| grep -vi "[0-9]\s*warning\|[0-9]\s*error\|[0-9]\s*info\|infos.f90\|information\|xhist, info)\|zmat, info)\|--warning\|--error" \
| grep -vi "pedantic-errors\|Werror\|warn\ errors\|diag-error-limit\|colour=error\|rounding\ error\|constraint\ violation\|default" \
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: Friday, November 03, 2023 PM02:57:20
! Last Modified: Thursday, December 21, 2023 PM03:06:15
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -171,7 +171,7 @@ subroutine uobyqb(calfun, iprint, maxfun, eta1, eta2, ftarget, gamma1, gamma2, r
! Report the current best value, and check if user asks for early termination.
terminate = .false.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0, terminate=terminate)
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, 0_IK, terminate=terminate)
if (terminate) then
subinfo = CALLBACK_TERMINATE
end if
Expand Down Expand Up @@ -470,7 +470,7 @@ subroutine uobyqb(calfun, iprint, maxfun, eta1, eta2, ftarget, gamma1, gamma2, r
if (sum(xpt(:, kopt)**2) >= 1.0E3_RP * delta**2) then
call shiftbase(kopt, pl, pq, xbase, xpt)
end if

! Report the current best value, and check if user asks for early termination.
if (present(callback_fcn)) then
call callback_fcn(xbase + xpt(:, kopt), fval(kopt), nf, tr, terminate=terminate)
Expand Down
12 changes: 6 additions & 6 deletions matlab/mex_gateways/tests/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,12 @@ $(TESTS) $(TESTS_INT):
| grep -v "NAG Fortran Compiler normal termination, [0-9]* info message" \
| grep -v "Warning: Change of value in conversion from .INTEGER(8). to .REAL(8). at (1) \[-Wconversion\]" \
| grep -v "Warning: Change of value in conversion from .REAL(16). to .REAL(8). at (1) \[-Wconversion\]" \
| grep -v "Extension: fmxapi\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "Extension: cbfun\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "Extension: \./classical/fmxcl\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "Extension: \./classical/fmxcl\.F90, line [0-9]*: Line longer than 132 characters" \
| grep -v "Extension: .*_mex\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "Extension: .*_mex\.F90, line [0-9]*: Line longer than 132 characters" \
| grep -v "Non-standard(Obsolete): fmxapi.F90, line 824: Byte count on numeric data type" \
| grep -v "cbfun\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "\./classical/fmxcl\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "\./classical/fmxcl\.F90, line [0-9]*: Line longer than 132 characters" \
| grep -v "\.F90, line [0-9]*: Byte count on numeric data type" \
| grep -v "\.F90, line [0-9]*: Line longer than 132 characters" \
| grep -v "detected at \*@[0-9]*" \
| grep -v "Info: fmxapi\.F90, line [0-9]*: Possibly discontiguous POUT passed to old style dummy" \
| grep -v "Info: No licences currently available for product" \
Expand Down

0 comments on commit 7171cd6

Please sign in to comment.