114subroutine sqrshc(m,n,k,Q,ldq,R,ldr,i,j,w)
117 integer,
intent(in) :: m, n, k, ldq, ldr, i, j
118 real(real32),
intent(inout) :: Q(ldq,*), R(ldr,*)
119 real(real32),
intent(out) :: w(*)
120 external scopy,sqrtv1,sqrqh,sqhqr,sqrot
123 if (m == 0 .or. n == 1)
return
130 else if (k /= m .and. (k /= n .or. n > m))
then
132 else if (i < 1 .or. i > n)
then
134 else if (j < 1 .or. j > n)
then
143 call scopy(k,r(1,i),1,w,1)
145 call scopy(k,r(1,l+1),1,r(1,l),1)
147 call scopy(k,w,1,r(1,j),1)
151 call sqhqr(kk+1-i,n+1-i,r(i,i),ldr,w(k+1),w)
153 call sqrot(
'F',m,kk+1-i,q(1,i),ldq,w(k+1),w)
157 call scopy(k,r(1,i),1,w,1)
159 call scopy(k,r(1,l-1),1,r(1,l),1)
161 call scopy(k,w,1,r(1,j),1)
167 call sqrtv1(kk+1-j,r(j,j),w(k+1))
169 call sqrqh(kk+1-j,n-j,r(j,jj),ldr,w(k+1),r(j+1,j))
171 call sqrot(
'B',m,kk+1-j,q(1,j),ldq,w(k+1),r(j+1,j))
subroutine sqrtv1(n, u, w)
Generates Givens rotations to eliminate all but the first element of a vector.
subroutine sqrot(dir, m, n, q, ldq, c, s)
Applies a sequence of Givens rotations from the right to a matrix.
subroutine sqhqr(m, n, r, ldr, c, s)
Reduces an upper Hessenberg matrix to upper trapezoidal form.
subroutine sqrshc(m, n, k, q, ldq, r, ldr, i, j, w)
Updates a QR factorization after a circular shift of columns.
subroutine sqrqh(m, n, r, ldr, c, s)
Converts an upper trapezoidal matrix to upper Hessenberg form.