dwnlt1 Subroutine

private subroutine dwnlt1(i, lend, mend, ir, mdw, recalc, imax, hbar, h, scale, w)

To update the column Sum Of Squares and find the pivot column. The column Sum of Squares Vector will be updated at each step. When numerically necessary, these values will be recomputed.

Revision history

  • 790701 DATE WRITTEN. Hanson, R. J., (SNLA), Haskell, K. H., (SNLA)
  • 890620 Code extracted from WNLIT and made a subroutine. (RWC))
  • 900604 DP version created from SP version. (RWC)

Arguments

Type IntentOptional Attributes Name
integer :: i
integer :: lend
integer :: mend
integer :: ir
integer :: mdw
logical :: recalc
integer :: imax
real(kind=wp) :: hbar
real(kind=wp) :: h(*)
real(kind=wp) :: scale(*)
real(kind=wp) :: w(mdw,*)

Calls

proc~~dwnlt1~~CallsGraph proc~dwnlt1 dwnlt1 proc~idamax idamax proc~dwnlt1->proc~idamax

Called by

proc~~dwnlt1~~CalledByGraph proc~dwnlt1 dwnlt1 proc~dwnlit dwnlit proc~dwnlit->proc~dwnlt1 proc~dwnlsm dwnlsm proc~dwnlsm->proc~dwnlit proc~dwnnls dwnnls proc~dwnnls->proc~dwnlsm proc~dlpdp dlpdp proc~dlpdp->proc~dwnnls proc~dlsi dlsi proc~dlsi->proc~dlpdp proc~dlsei dlsei proc~dlsei->proc~dlsi proc~dfcmn dfcmn proc~dfcmn->proc~dlsei proc~dfc dfc proc~dfc->proc~dfcmn

Source Code

   subroutine dwnlt1 (i, lend, mend, ir, mdw, recalc, imax, hbar, h, &
                      scale, w)

   integer :: i, imax, ir, lend, mdw, mend
   real(wp) :: h(*), hbar, scale(*), w(mdw,*)
   logical :: recalc

   integer :: j, k

   if (ir/=1 .and. (.not.recalc)) then
      ! Update column SS=sum of squares.
      do j=i,lend
         h(j) = h(j) - scale(ir-1)*w(ir-1,j)**2
      end do
      ! Test for numerical accuracy.
      imax = idamax(lend-i+1, h(i), 1) + i - 1
      recalc = (hbar+1.e-3*h(imax)) == hbar
   endif

   ! If required, recalculate column SS, using rows IR through MEND.
   if (recalc) then
      do j=i,lend
         h(j) = 0.0_wp
         do k=ir,mend
            h(j) = h(j) + scale(k)*w(k,j)**2
         end do
      end do
      ! Find column with largest SS.
      imax = idamax(lend-i+1, h(i), 1) + i - 1
      hbar = h(imax)
   endif

   end subroutine dwnlt1