determine_new_active_linear_constr Subroutine

private subroutine determine_new_active_linear_constr(nf, nc, cf, cfd, ic, cl, cu, cg, s, eps9, par, kbc, inew, knew)

determination of the new active linear constraint.

Note

This routine was formerly called plminn.

Arguments

Type IntentOptional Attributes Name
integer :: nf

number of variables.

integer :: nc

number of constraints.

real(kind=wp) :: cf(*)

cf(nc) vector containing values of the constraint functions.

real(kind=wp) :: cfd(*)

cfd(nc) vector containing increments of the constraint functions.

integer :: ic(*)

ic(nc) vector containing types of constraints.

real(kind=wp) :: cl(*)

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

real(kind=wp) :: cu(*)

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

real(kind=wp) :: cg(*)

cg(nf*nc) matrix whose columns are normals of the linear constraints.

real(kind=wp) :: s(*)

s(nf) direction vector.

real(kind=wp) :: eps9

tolerance for active constraints.

real(kind=wp) :: par

auxiliary variable.

integer :: kbc

specification of linear constraints.

  • kbc=0 - no linear constraints.
  • kbc=1 - one sided linear constraints.
  • kbc=2 - two sided linear constraints.
integer :: inew

index of the new active constraint.

integer :: knew

signum of the new active normal.


Calls

proc~~determine_new_active_linear_constr~~CallsGraph proc~determine_new_active_linear_constr determine_new_active_linear_constr proc~mxvdot mxvdot proc~determine_new_active_linear_constr->proc~mxvdot

Called by

proc~~determine_new_active_linear_constr~~CalledByGraph proc~determine_new_active_linear_constr determine_new_active_linear_constr proc~dual_range_space_quad_prog psqp_class%dual_range_space_quad_prog proc~dual_range_space_quad_prog->proc~determine_new_active_linear_constr proc~psqp psqp_class%psqp proc~psqp->proc~dual_range_space_quad_prog proc~psqpn psqp_class%psqpn proc~psqpn->proc~psqp

Source Code

   subroutine determine_new_active_linear_constr(nf, nc, cf, cfd, ic, cl, cu, &
                                                 cg, s, eps9, par, kbc, inew, knew)

      integer :: nf      !! number of variables.
      integer :: nc      !! number of constraints.
      integer :: ic(*)   !! ic(nc)  vector containing types of constraints.
      integer :: kbc     !! specification of linear constraints.
                         !!
                         !! * kbc=0 - no linear constraints.
                         !! * kbc=1 - one sided linear constraints.
                         !! * kbc=2 - two sided linear constraints.
      integer :: inew    !! index of the new active constraint.
      integer :: knew    !! signum of the new active normal.
      real(wp) :: cf(*)  !! cf(nc)  vector containing values of the
                         !! constraint functions.
      real(wp) :: cfd(*) !! cfd(nc)  vector containing increments of
                         !! the constraint functions.
      real(wp) :: cl(*)  !! cl(nc)  vector containing lower bounds for
                         !! constraint functions.
      real(wp) :: cu(*)  !! cu(nc)  vector containing upper bounds for
                         !! constraint functions.
      real(wp) :: cg(*)  !! cg(nf*nc)  matrix whose columns are normals
                         !! of the linear constraints.
      real(wp) :: s(*)   !! s(nf)  direction vector.
      real(wp) :: eps9   !! tolerance for active constraints.
      real(wp) :: par    !! auxiliary variable.

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

      if (kbc > 0) then
         jcg = 1
         do kc = 1, nc
            if (ic(kc) > 0) then
               temp = mxvdot(nf, cg(jcg), s)
               cfd(kc) = temp
               temp = cf(kc) + temp
               if (ic(kc) == 1 .or. ic(kc) >= 3) then
                  pom = temp - cl(kc)
                  if (pom < min(par, -eps9*max(abs(cl(kc)), 1.0_wp))) then
                     inew = kc
                     knew = 1
                     par = pom
                  end if
               end if
               if (ic(kc) == 2 .or. ic(kc) >= 3) then
                  pom = cu(kc) - temp
                  if (pom < min(par, -eps9*max(abs(cu(kc)), 1.0_wp))) then
                     inew = kc
                     knew = -1
                     par = pom
                  end if
               end if
            end if
            jcg = jcg + nf
         end do
      end if

   end subroutine determine_new_active_linear_constr