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.
Type | Intent | Optional | 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,*) |
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