Skip to content

Commit

Permalink
230717.000813.CST revise cobyla.f90.new
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jul 16, 2023
1 parent 3a3e58a commit c3b20e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions fortran/cobyla/cobyla.f90.new
Original file line number Diff line number Diff line change
Expand Up @@ -614,17 +614,19 @@ real(RP), intent(in) :: x_internal(:)
real(RP), intent(out) :: f_internal
real(RP), intent(out) :: constr_internal(:)
! Local variables
integer(IK), allocatable :: ixl(:), ixu(:)
integer(IK), allocatable :: ixl(:), ixu(:), mxl, mxu
real(RP) :: constr_nlc(m_nonlcon)

call calcfc(x_internal, f_internal, constr_nlc)
mxl = int(count(xl > -REALMAX), IK)
mxu = int(count(xu < REALMAX), IK)
call safealloc(ixl, mxl)
call safealloc(ixu, mxu)
ixl = trueloc(xl > -REALMAX)
ixu = trueloc(xu < REALMAX)
constr_internal = [x_internal(ixl) - xl(ixl), xu(ixu) - x_internal(ixu), &
& matprod(Aeq, x_internal) - beq, beq - matprod(Aeq, x_internal), &
& matprod(Aineq, x_internal) - bineq, constr_nlc]
& bineq - matprod(Aineq, x_internal), constr_nlc]
end subroutine

end subroutine cobyla
Expand Down
4 changes: 2 additions & 2 deletions fortran/common/linalg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module linalg_mod
!
! Started: July 2020
!
! Last Modified: Wednesday, July 05, 2023 PM03:44:51
! Last Modified: Sunday, July 16, 2023 PM11:51:27
!--------------------------------------------------------------------------------------------------!

implicit none
Expand Down Expand Up @@ -1062,7 +1062,7 @@ function lsqr_Rfull(b, Q, R) result(x)
! This function solves the linear least squares problem min ||A*x - b||_2 by the QR factorization.
! This function is used in LINCOA, where,
! 1. The economy-size QR factorization is supplied externally (Q is called QFAC and R is called RFAC);
! 3. R is non-singular.
! 2. R is non-singular.
!--------------------------------------------------------------------------------------------------!
use, non_intrinsic :: consts_mod, only : RP, IK, EPS, DEBUGGING
use, non_intrinsic :: debug_mod, only : assert
Expand Down

0 comments on commit c3b20e8

Please sign in to comment.