Skip to content

Commit

Permalink
231019.104344.HKT minor revision to fortran comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Oct 19, 2023
1 parent 15eeca9 commit a044b2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions fortran/cobyla/cobyla.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module cobyla_mod
!
! Started: July 2021
!
! Last Modified: Wednesday, October 18, 2023 PM08:29:41
! Last Modified: Thursday, October 19, 2023 AM10:39:21
!--------------------------------------------------------------------------------------------------!

implicit none
Expand All @@ -67,12 +67,12 @@ subroutine cobyla(calcfc, m_nlcon, x, &
! will take the default value detailed below. For instance, we may invoke the solver as follows.
!
! ! First define CALCFC, M_NLCON, and X, and then do the following.
! call cobyla(calcfc, m_nlcon, x, f)
! call cobyla(calcfc, m_nlcon, x, f, cstrv)
!
! or
!
! ! First define CALCFC, M_NLCON, and X, and then do the following.
! call cobyla(calcfc, m_nlcon, x, f, rhobeg = 0.5D0, rhoend = 1.0D-3, maxfun = 100)
! call cobyla(calcfc, m_nlcon, x, f, cstrv, rhobeg = 0.5D0, rhoend = 1.0D-3, maxfun = 100)
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ! IMPORTANT NOTICE: The user must set M_NLCON correctly to the number of nonlinear constraints,
Expand Down Expand Up @@ -127,8 +127,9 @@ subroutine cobyla(calcfc, m_nlcon, x, &
! MAXVAL([0, XL - X, X - XU, Aineq*X - Bineq, ABS(Aeq*X -Beq), NLCONSTR(X)]).
!
! NLCONSTR
! Output, ALLOCATABLE REAL(RP) vector.
! NLCONSTR will be set to the nonlinear constraint value of X at exit.
! Output, REAL(RP) vector.
! NLCONSTR should be an M_NLCON-dimensional vector and will be set to the nonlinear constraint
! value of X at exit.
!
! Aineq, Bineq
! Input, REAL(RP) matrix of size [Mineq, N] and REAL vector of size Mineq unless they are both
Expand Down Expand Up @@ -276,7 +277,7 @@ subroutine cobyla(calcfc, m_nlcon, x, &
! Compulsory arguments
procedure(OBJCON) :: calcfc ! N.B.: INTENT cannot be specified if a dummy procedure is not a POINTER
real(RP), intent(inout) :: x(:) ! X(N)
integer(IK), intent(in) :: m_nlcon
integer(IK), intent(in) :: m_nlcon ! Number of constraints defined in CALCFC

! Optional inputs
integer(IK), intent(in), optional :: iprint
Expand Down
8 changes: 4 additions & 4 deletions fortran/lincoa/lincoa.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module lincoa_mod
!
! Started: February 2022
!
! Last Modified: Wednesday, October 18, 2023 PM07:11:31
! Last Modified: Thursday, October 19, 2023 AM10:34:35
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -65,7 +65,7 @@ subroutine lincoa(calfun, x, &
! or
!
! ! First define CALFUN, X, Aineq, and Bineq, and then do the following.
! call lincoa(calfun, x, f, Aineq = Aineq, bineq = bineq, rhobeg = 0.5D0, rhoend = 1.0D-3, maxfun = 100)
! call lincoa(calfun, x, f, cstrv, Aineq = Aineq, bineq = bineq, rhobeg = 0.5D0, rhoend = 1.0D-3, maxfun = 100)
!
! See examples/lincoa_exmp.f90 for a concrete example.
!
Expand Down Expand Up @@ -135,8 +135,8 @@ subroutine lincoa(calfun, x, &
! CTOL
! Input, REAL(RP) scalar, default: machine epsilon.
! CTOL is the tolerance of constraint violation. X is considered feasible if CSTRV(X) <= CTOL.
! N.B.: 1. CTOL is absolute, not relative. 2. CTOL is used only when selecting the returned X.
! It does not affect the iterations of the algorithm.
! N.B.: 1. CTOL is absolute, not relative.
! 2. CTOL is used for choosing the returned X. It does not affect the iterations of the algorithm.
!
! CWEIGHT
! Input, REAL(RP) scalar, default: CWEIGHT_DFT defined in the module CONSTS_MOD in common/consts.F90.
Expand Down

0 comments on commit a044b2c

Please sign in to comment.