This subroutine counts the entering and leaving variables when iter > 0, and finds the index set of free and active variables at the GCP.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
integer, | intent(inout) | :: | Nfree | |||
integer, | intent(inout) | :: | Index(n) |
|
||
integer, | intent(out) | :: | Nenter | |||
integer, | intent(out) | :: | Ileave | |||
integer, | intent(inout) | :: | Indx2(n) |
|
||
integer, | intent(in) | :: | Iwhere(n) | |||
logical, | intent(out) | :: | Wrk | |||
logical, | intent(in) | :: | Updatd | |||
logical, | intent(in) | :: | Cnstnd |
indicating whether bounds are present |
||
integer, | intent(in) | :: | Iprint |
Controls the frequency and type of output generated |
||
integer, | intent(in) | :: | Iter |
subroutine freev(n,Nfree,Index,Nenter,Ileave,Indx2,Iwhere,Wrk, & Updatd,Cnstnd,Iprint,Iter) implicit none integer,intent(in) :: n integer,intent(inout) :: Nfree integer,intent(out) :: Nenter integer,intent(out) :: Ileave integer,intent(in) :: Iprint !! Controls the frequency and type of output generated integer,intent(in) :: Iter integer,intent(inout) :: Index(n) !! * for i=1,...,nfree, index(i) are the indices of free variables !! * for i=nfree+1,...,n, index(i) are the indices of bound variables !! !! * On entry after the first iteration, index gives !! the free variables at the previous iteration. !! * On exit it gives the free variables based on the determination !! in cauchy using the array iwhere. integer,intent(inout) :: Indx2(n) !! * On entry indx2 is unspecified. !! * On exit with iter>0, indx2 indicates which variables !! have changed status since the previous iteration. !! !! * For i= 1,...,nenter, indx2(i) have changed from bound to free. !! * For i= ileave+1,...,n, indx2(i) have changed from free to bound. integer,intent(in) :: Iwhere(n) logical,intent(out) :: Wrk logical,intent(in) :: Updatd logical,intent(in) :: Cnstnd !! indicating whether bounds are present integer :: iact , i , k Nenter = 0 Ileave = n + 1 if ( Iter>0 .and. Cnstnd ) then ! count the entering and leaving variables. do i = 1 , Nfree k = Index(i) ! write(output_unit,*) ' k = index(i) ', k ! write(output_unit,*) ' index = ', i if ( Iwhere(k)>0 ) then Ileave = Ileave - 1 Indx2(Ileave) = k if ( Iprint>=100 ) write (output_unit,*) 'Variable ' , k , & &' leaves the set of free variables' endif enddo do i = 1 + Nfree , n k = Index(i) if ( Iwhere(k)<=0 ) then Nenter = Nenter + 1 Indx2(Nenter) = k if ( Iprint>=100 ) write (output_unit,*) 'Variable ' , k , & &' enters the set of free variables' endif enddo if ( Iprint>=99 ) write (output_unit,*) n + 1 - Ileave , & &' variables leave; ' , Nenter , & &' variables enter' endif Wrk = (Ileave<n+1) .or. (Nenter>0) .or. Updatd ! Find the index set of free and active variables at the GCP. Nfree = 0 iact = n + 1 do i = 1 , n if ( Iwhere(i)<=0 ) then Nfree = Nfree + 1 Index(Nfree) = i else iact = iact - 1 Index(iact) = i endif enddo if ( Iprint>=99 ) write (output_unit,*) Nfree , & ' variables are free at GCP ' , & Iter + 1 end subroutine freev