compute_augmented_lagrangian Subroutine

private pure subroutine compute_augmented_lagrangian(nf, n, nc, cf, ic, ica, cl, cu, cz, rpf, fc, f)

computation of value of the augmented lagrangian function.

Note

This routine was formerly called pp0af8.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nf

number of variables.

integer, intent(in) :: n

dimension of the constraint null space.

integer, intent(in) :: nc

number of constraints.

real(kind=wp), intent(in) :: cf(*)

cf(nc+1) vector containing values of the constraints.

integer, intent(in) :: ic(*)

ic(nc) vector containing types of constraints.

integer, intent(in) :: ica(*)

ica(nf) vector containing indices of active constraints.

real(kind=wp), intent(in) :: cl(*)

cl(nc) vector containing lower bounds for constraint functions.

real(kind=wp), intent(in) :: cu(*)

cu(nc) vector containing upper bounds for constraint functions.

real(kind=wp), intent(in) :: cz(*)

cz(nc) vector of lagrange multipliers.

real(kind=wp), intent(in) :: rpf

penalty coefficient.

real(kind=wp), intent(out) :: fc

value of the penalty term.

real(kind=wp), intent(out) :: f

value of the penalty function.


Called by

proc~~compute_augmented_lagrangian~~CalledByGraph proc~compute_augmented_lagrangian compute_augmented_lagrangian proc~psqp psqp_class%psqp proc~psqp->proc~compute_augmented_lagrangian proc~psqpn psqp_class%psqpn proc~psqpn->proc~psqp

Source Code

   pure subroutine compute_augmented_lagrangian(nf, n, nc, cf, ic, ica, cl, cu, cz, rpf, fc, f)

      integer,intent(in) :: nf      !! number of variables.
      integer,intent(in) :: n       !! dimension of the constraint null space.
      integer,intent(in) :: nc      !! number of constraints.
      integer,intent(in) :: ic(*)   !! ic(nc)  vector containing types of constraints.
      integer,intent(in) :: ica(*)  !! ica(nf)  vector containing indices of active constraints.
      real(wp),intent(in) :: cf(*)  !! cf(nc+1)  vector containing values of the constraints.
      real(wp),intent(in) :: cl(*)  !! cl(nc)  vector containing lower bounds for constraint functions.
      real(wp),intent(in) :: cu(*)  !! cu(nc)  vector containing upper bounds for constraint functions.
      real(wp),intent(in) :: cz(*)  !! cz(nc)  vector of lagrange multipliers.
      real(wp),intent(in) :: rpf    !! penalty coefficient.
      real(wp),intent(out) :: fc    !! value of the penalty term.
      real(wp),intent(out) :: f     !! value of the penalty function.

      real(wp) :: pom, temp
      integer :: j, kc

      fc = 0.0_wp
      do kc = 1, nc
         if (ic(kc) > 0) then
            pom = 0.0_wp
            temp = cf(kc)
            if (ic(kc) == 1 .or. ic(kc) >= 3) pom = min(pom, temp - cl(kc))
            if (ic(kc) == 2 .or. ic(kc) >= 3) pom = min(pom, cu(kc) - temp)
            fc = fc + rpf*abs(pom)
         end if
      end do
      do j = 1, nf - n
         kc = ica(j)
         if (kc > 0) then
            pom = 0.0_wp
            temp = cf(kc)
            if (ic(kc) == 1 .or. ic(kc) == 3 .or. ic(kc) == 5) &
               pom = min(pom, temp - cl(kc))
            if (ic(kc) == 2 .or. ic(kc) == 4 .or. ic(kc) == 6) &
               pom = max(pom, temp - cu(kc))
            fc = fc - cz(j)*pom
         end if
      end do
      f = cf(nc + 1) + fc

   end subroutine compute_augmented_lagrangian