115subroutine sqrinc(m,n,k,Q,ldq,R,ldr,j,x,w)
118 integer,
intent(in) :: m, n, k, ldq, ldr, j
119 real(real32),
intent(inout) :: Q(ldq,*), R(ldr,*)
120 real(real32),
intent(in) :: x(*)
121 real(real32),
intent(out) :: w(*)
122 external sqrtv1,sqrqh,sqrot
123 external scopy,sdot,saxpy,sscal,snrm2,sgqvec
124 real(real32) sdot,snrm2,rx
135 else if (k /= m .and. (k /= n .or. n >= m))
then
137 else if (ldq < m)
then
139 else if (ldr < min(m,k+1))
then
141 else if (j < 1 .or. j > n+1)
then
151 call scopy(k,r(1,i),1,r(1,i+1),1)
157 r(i,j) = sdot(m,q(1,i),1,x,1)
165 call scopy(m,x,1,q(1,k1),1)
167 r(i,j) = sdot(m,q(1,i),1,q(1,k1),1)
168 call saxpy(m,-r(i,j),q(1,i),1,q(1,k1),1)
171 rx = snrm2(m,q(1,k1),1)
177 call sgqvec(m,k,q,ldq,q(1,k1))
180 call sscal(m,1e0/rx,q(1,k1),1)
186 call sqrtv1(k1+1-j,r(j,j),w)
188 if (j <= n)
call sqrqh(k1+1-j,n+1-j,r(j,j+1),ldr,w,r(j+1,j))
190 call sqrot(
'B',m,k1+1-j,q(1,j),ldq,w,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 sgqvec(m, n, q, ldq, u)
Generates a unit vector orthogonal to the column space of a unitary matrix.
subroutine sqrinc(m, n, k, q, ldq, r, ldr, j, x, w)
Updates a QR factorization after inserting a new column.
subroutine sqrqh(m, n, r, ldr, c, s)
Converts an upper trapezoidal matrix to upper Hessenberg form.