115subroutine dqrinc(m,n,k,Q,ldq,R,ldr,j,x,w)
118 integer,
intent(in) :: m, n, k, ldq, ldr, j
119 real(real64),
intent(inout) :: Q(ldq,*)
120 real(real64),
intent(inout) :: R(ldr,*)
121 real(real64),
intent(in) :: x(*)
122 real(real64),
intent(out) :: w(*)
123 external dqrtv1,dqrqh,dqrot,dgqvec
124 external dcopy,ddot,daxpy,dscal,dnrm2
125 real(real64) ddot,dnrm2,rx
136 else if (k /= m .and. (k /= n .or. n >= m))
then
138 else if (ldq < m)
then
140 else if (ldr < min(m,k+1))
then
142 else if (j < 1 .or. j > n+1)
then
152 call dcopy(k,r(1,i),1,r(1,i+1),1)
158 r(i,j) = ddot(m,q(1,i),1,x,1)
166 call dcopy(m,x,1,q(1,k1),1)
168 r(i,j) = ddot(m,q(1,i),1,q(1,k1),1)
169 call daxpy(m,-r(i,j),q(1,i),1,q(1,k1),1)
172 rx = dnrm2(m,q(1,k1),1)
178 call dgqvec(m,k,q,ldq,q(1,k1))
181 call dscal(m,1d0/rx,q(1,k1),1)
187 call dqrtv1(k1+1-j,r(j,j),w)
189 if (j <= n)
call dqrqh(k1+1-j,n+1-j,r(j,j+1),ldr,w,r(j+1,j))
191 call dqrot(
'B',m,k1+1-j,q(1,j),ldq,w,r(j+1,j))
subroutine dqrtv1(n, u, w)
Generates Givens rotations to eliminate all but the first element of a vector.
subroutine dqrot(dir, m, n, q, ldq, c, s)
Applies a sequence of Givens rotations from the right to a matrix.
subroutine dqrqh(m, n, r, ldr, c, s)
Converts an upper trapezoidal matrix to upper Hessenberg form.
subroutine dqrinc(m, n, k, q, ldq, r, ldr, j, x, w)
Updates a QR factorization after inserting a new column.
subroutine dgqvec(m, n, q, ldq, u)
Generates a unit vector orthogonal to the column space of a unitary matrix.