Skip to content

Commit

Permalink
240407.163456.HKT revise the wording of comments on automatic dealloc…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
zaikunzhang committed Apr 7, 2024
1 parent 92f8a6e commit ae9c559
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions c/bobyqa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ subroutine bobyqa_c(cobj_ptr, data_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, &
nf = int(nf_loc, kind(nf))
info = int(info_loc, kind(info))

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(npt_loc)) deallocate (npt_loc)
if (allocated(maxfun_loc)) deallocate (maxfun_loc)
if (allocated(rhoend_loc)) deallocate (rhoend_loc)
Expand Down Expand Up @@ -226,7 +226,7 @@ subroutine callback_fcn(x_sub, f_sub, nf_sub, tr, cstrv_sub, nlconstr_sub, termi
terminate = logical(terminate_loc, kind(terminate))
end if

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(nlconstr_sub_loc)) deallocate (nlconstr_sub_loc)

end subroutine callback_fcn
Expand Down
4 changes: 2 additions & 2 deletions c/cobyla_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ subroutine cobyla_c(m_nlcon, cobjcon_ptr, data_ptr, n, x, f, cstrv, nlconstr, m_
info = int(info_loc, kind(info))
nlconstr = real(nlconstr_loc, kind(nlconstr))

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(maxfun_loc)) deallocate (maxfun_loc)
if (allocated(rhoend_loc)) deallocate (rhoend_loc)
if (allocated(rhobeg_loc)) deallocate (rhobeg_loc)
Expand Down Expand Up @@ -268,7 +268,7 @@ subroutine callback_fcn(x_sub, f_sub, nf_sub, tr, cstrv_sub, nlconstr_sub, termi
terminate = logical(terminate_loc, kind(terminate))
end if

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(nlconstr_sub_loc)) deallocate (nlconstr_sub_loc)

end subroutine callback_fcn
Expand Down
4 changes: 2 additions & 2 deletions c/lincoa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ subroutine lincoa_c(cobj_ptr, data_ptr, n, x, f, cstrv, m_ineq, Aineq, bineq, m_
nf = int(nf_loc, kind(nf))
info = int(info_loc, kind(info))

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(npt_loc)) deallocate (npt_loc)
if (allocated(maxfun_loc)) deallocate (maxfun_loc)
if (allocated(rhoend_loc)) deallocate (rhoend_loc)
Expand Down Expand Up @@ -254,7 +254,7 @@ subroutine callback_fcn(x_sub, f_sub, nf_sub, tr, cstrv_sub, nlconstr_sub, termi
terminate = logical(terminate_loc, kind(terminate))
end if

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(nlconstr_sub_loc)) deallocate (nlconstr_sub_loc)

end subroutine callback_fcn
Expand Down
4 changes: 2 additions & 2 deletions c/newuoa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine newuoa_c(cobj_ptr, data_ptr, n, x, f, nf, rhobeg, rhoend, ftarget, ma
nf = int(nf_loc, kind(nf))
info = int(info_loc, kind(info))

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(npt_loc)) deallocate (npt_loc)
if (allocated(maxfun_loc)) deallocate (maxfun_loc)
if (allocated(rhoend_loc)) deallocate (rhoend_loc)
Expand Down Expand Up @@ -205,7 +205,7 @@ subroutine callback_fcn(x_sub, f_sub, nf_sub, tr, cstrv_sub, nlconstr_sub, termi
terminate = logical(terminate_loc, kind(terminate))
end if

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(nlconstr_sub_loc)) deallocate (nlconstr_sub_loc)

end subroutine callback_fcn
Expand Down
4 changes: 2 additions & 2 deletions c/uobyqa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ subroutine uobyqa_c(cobj_ptr, data_ptr, n, x, f, nf, rhobeg, rhoend, ftarget, ma
nf = int(nf_loc, kind(nf))
info = int(info_loc, kind(info))

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(maxfun_loc)) deallocate (maxfun_loc)
if (allocated(rhoend_loc)) deallocate (rhoend_loc)
if (allocated(rhobeg_loc)) deallocate (rhobeg_loc)
Expand Down Expand Up @@ -199,7 +199,7 @@ subroutine callback_fcn(x_sub, f_sub, nf_sub, tr, cstrv_sub, nlconstr_sub, termi
terminate = logical(terminate_loc, kind(terminate))
end if

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
if (allocated(nlconstr_sub_loc)) deallocate (nlconstr_sub_loc)

end subroutine callback_fcn
Expand Down
2 changes: 1 addition & 1 deletion fortran/classical/lincoa/lincoa.f90
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ subroutine lincoa(calfun, x, f, &
& int(size(chist_loc), kind=IK))
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Deallocate A_LOC, B_LOC, etc. Indeed, automatic deallocation will take place at exit.
! Deallocate A_LOC, B_LOC, etc. We prefer explicit deallocation to the automatic one.
deallocate (A_loc)
deallocate (b_loc)
deallocate (iact)
Expand Down
2 changes: 1 addition & 1 deletion fortran/cobyla/cobyla.f90
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ subroutine cobyla(calcfc, m_nlcon, x, &
end if
!--------------------------------------------------------------------------------------------------!

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
deallocate (Aineq_loc, Aeq_loc, amat, bineq_loc, beq_loc, bvec)


Expand Down
2 changes: 1 addition & 1 deletion fortran/lincoa/lincoa.f90
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ subroutine lincoa(calfun, x, &
end if
!--------------------------------------------------------------------------------------------------!

! Deallocate variables not needed any more. Indeed, automatic deallocation will take place at exit.
! Deallocate variables not needed any more. We prefer explicit deallocation to the automatic one.
deallocate (Aineq_loc, Aeq_loc, amat, bineq_loc, beq_loc, bvec)


Expand Down
4 changes: 2 additions & 2 deletions matlab/mex_gateways/bobyqa_mex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!
! Started in July 2020
!
! Last Modified: Sunday, February 25, 2024 AM11:38:39
! Last Modified: Sunday, April 07, 2024 PM04:31:30
!--------------------------------------------------------------------------------------------------!

#include "fintrf.h"
Expand Down Expand Up @@ -119,7 +119,7 @@ subroutine mexFunction(nargout, poutput, nargin, pinput)
! It can happen that 0 < SIZE(XHIST, 2) < MAXHIST or 0 < SIZE(FHIST) < MAXHIST due to the memory
! limit in the Fortran code.

! Free memory. Indeed, automatic deallocation would take place.
! Free memory. We prefer explicit deallocation to the automatic one.
deallocate (x) ! Allocated by fmxReadMPtr.
deallocate (lb) ! Allocated by fmxReadMPtr.
deallocate (ub) ! Allocated by fmxReadMPtr.
Expand Down
4 changes: 2 additions & 2 deletions matlab/mex_gateways/cobyla_mex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!
! Started in July 2020
!
! Last Modified: Sunday, February 25, 2024 AM11:26:21
! Last Modified: Sunday, April 07, 2024 PM04:31:08
!--------------------------------------------------------------------------------------------------!

#include "fintrf.h"
Expand Down Expand Up @@ -169,7 +169,7 @@ subroutine mexFunction(nargout, poutput, nargin, pinput)
! It can happen that 0 < SIZE(XHIST, 2) < MAXHIST or 0 < SIZE(FHIST) < MAXHIST due to the memory
! limit in the Fortran code. Similar for CHIST and CONHIST.

! Free memory. Indeed, automatic deallocation would take place.
! Free memory. We prefer explicit deallocation to the automatic one.
deallocate (x) ! Allocated by fmxReadMPtr.
deallocate (nlconstr0) ! Allocated by fmxReadMPtr.
deallocate (Aineq) ! Allocated by fmxReadMPtr.
Expand Down
6 changes: 3 additions & 3 deletions matlab/mex_gateways/fmxapi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module fmxapi_mod
!
! Started in July 2020
!
! Last Modified: Tuesday, January 02, 2024 PM02:27:24
! Last Modified: Sunday, April 07, 2024 PM04:30:44
!--------------------------------------------------------------------------------------------------!

! N.B.:
Expand Down Expand Up @@ -460,7 +460,7 @@ subroutine read_rvector(px, x)
end if
end if

! Deallocate X_DP. Indeed, automatic deallocation would take place.
! Deallocate X_DP. We prefer explicit deallocation to the automatic one.
deallocate (x_dp)
end subroutine read_rvector

Expand Down Expand Up @@ -514,7 +514,7 @@ subroutine read_rmatrix(px, x)
end if
end if

! Deallocate X_DP. Indeed, automatic deallocation would take place.
! Deallocate X_DP. We prefer explicit deallocation to the automatic one.
deallocate (x_dp)
end subroutine read_rmatrix

Expand Down
4 changes: 2 additions & 2 deletions matlab/mex_gateways/lincoa_mex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!
! Started in July 2020
!
! Last Modified: Sunday, February 25, 2024 AM11:26:14
! Last Modified: Sunday, April 07, 2024 PM04:31:37
!--------------------------------------------------------------------------------------------------!

#include "fintrf.h"
Expand Down Expand Up @@ -139,7 +139,7 @@ subroutine mexFunction(nargout, poutput, nargin, pinput)
! It can happen that 0 < SIZE(XHIST, 2) < MAXHIST or 0 < SIZE(FHIST) < MAXHIST due to the memory
! limit in the Fortran code. Similar for CHIST.

! Free memory. Indeed, automatic deallocation would take place.
! Free memory. We prefer explicit deallocation to the automatic one.
deallocate (x) ! Allocated by fmxReadMPtr.
deallocate (Aineq) ! Allocated by fmxReadMPtr.
deallocate (bineq) ! Allocated by fmxReadMPtr.
Expand Down
4 changes: 2 additions & 2 deletions matlab/mex_gateways/newuoa_mex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!
! Started in July 2020
!
! Last Modified: Sunday, February 25, 2024 AM11:28:20
! Last Modified: Sunday, April 07, 2024 PM04:30:58
!--------------------------------------------------------------------------------------------------!

#include "fintrf.h"
Expand Down Expand Up @@ -115,7 +115,7 @@ subroutine mexFunction(nargout, poutput, nargin, pinput)
! It can happen that 0 < SIZE(XHIST, 2) < MAXHIST or 0 < SIZE(FHIST) < MAXHIST due to the memory
! limit in the Fortran code.

! Free memory. Indeed, automatic deallocation would take place.
! Free memory. We prefer explicit deallocation to the automatic one.
deallocate (x) ! Allocated by fmxReadMPtr.
deallocate (xhist) ! Allocated by the solver
deallocate (fhist) ! Allocated by the solver
Expand Down
4 changes: 2 additions & 2 deletions matlab/mex_gateways/uobyqa_mex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!
! Started in July 2020
!
! Last Modified: Sunday, February 25, 2024 AM11:27:25
! Last Modified: Sunday, April 07, 2024 PM04:31:18
!--------------------------------------------------------------------------------------------------!

#include "fintrf.h"
Expand Down Expand Up @@ -113,7 +113,7 @@ subroutine mexFunction(nargout, poutput, nargin, pinput)
! It can happen that 0 < SIZE(XHIST, 2) < MAXHIST or 0 < SIZE(FHIST) < MAXHIST due to the memory
! limit in the Fortran code.

! Free memory. Indeed, automatic deallocation would take place.
! Free memory. We prefer explicit deallocation to the automatic one.
deallocate (x) ! Allocated by fmxReadMPtr.
deallocate (xhist) ! Allocated by the solver
deallocate (fhist) ! Allocated by the solver
Expand Down

0 comments on commit ae9c559

Please sign in to comment.