116subroutine sqr1up(m,n,k,Q,ldq,R,ldr,u,v,w)
119 integer,
intent(in) :: m, n, k, ldq, ldr
120 real(real32),
intent(inout) :: Q(ldq,*), R(ldr,*)
121 real(real32),
intent(inout) :: u(*), v(*)
122 real(real32),
intent(out) :: w(*)
123 external sqrqh,sqhqr,sqrot,sqrtv1,sch1up
124 external saxpy,sdot,snrm2,slamch,sscal,srot
125 real(real32) sdot,snrm2,slamch,ru,ruu
129 if (k == 0 .or. n == 0)
return
136 else if (k /= m .and. (k /= n .or. n > m))
then
138 else if (ldq < m)
then
140 else if (ldr < k)
then
150 if (.not.full) ru = snrm2(m,u,1)
153 w(i) = sdot(m,q(1,i),1,u,1)
154 if (.not.full)
call saxpy(m,-w(i),q(1,i),1,u,1)
159 call sqrqh(k,n,r,ldr,w(k+1),w(2))
161 call sqrot(
'B',m,k,q,ldq,w(k+1),w(2))
163 call saxpy(n,w(1),v,1,r(1,1),ldr)
165 call sqhqr(k,n,r,ldr,w(k+1),w)
167 call sqrot(
'F',m,min(k,n+1),q,ldq,w(k+1),w)
172 ru = ru * slamch(
'e')
173 if (ruu <= ru)
return
175 call sscal(n,ruu,v,1)
176 call sscal(m,1e0/ruu,u,1)
177 call sch1up(n,r,ldr,v,w(k+1))
179 call srot(m,q(1,i),1,u,1,w(k+i),v(i))
subroutine sch1up(n, r, ldr, u, w)
Updates a Cholesky factorization after a rank-1 modification.
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 sqr1up(m, n, k, q, ldq, r, ldr, u, v, w)
Updates a QR factorization after a rank-1 modification.
subroutine sqrqh(m, n, r, ldr, c, s)
Converts an upper trapezoidal matrix to upper Hessenberg form.