1 subroutine qform
(m
,n
,q
,ldq
,wa
)
3 double precision q
(ldq
,m
),wa
(m
)
8 c this subroutine proceeds from the computed qr factorization of
9 c an m by n matrix a to accumulate the m by m orthogonal matrix
10 c q from its factored form.
12 c the subroutine statement is
14 c subroutine qform(m,n,q,ldq,wa)
18 c m is a positive integer input variable set to the number
19 c of rows of a and the order of q.
21 c n is a positive integer input variable set to the number
24 c q is an m by m array. on input the full lower trapezoid in
25 c the first min(m,n) columns of q contains the factored form.
26 c on output q has been accumulated into a square matrix.
28 c ldq is a positive integer input variable not less than m
29 c which specifies the leading dimension of the array q.
31 c wa is a work array of length m.
35 c fortran-supplied ... min0
37 c argonne national laboratory. minpack project. march 1980.
38 c burton s. garbow, kenneth e. hillstrom, jorge j. more
41 integer i
,j
,jm1
,k
,l
,minmn
,np1
42 double precision one
,sum
,temp
,zero
43 data one
,zero
/1.0d0
,0.0d0
/
45 c zero out upper triangle of q in the first min(m,n) columns.
48 if (minmn
.lt
. 2) go to 30
57 c initialize remaining columns to those of the identity matrix.
60 if (m
.lt
. np1
) go to 60
69 c accumulate q from its factored form.
78 if (wa
(k
) .eq
. zero
) go to 110
82 sum
= sum
+ q
(i
,j
)*wa
(i
)
86 q
(i
,j
) = q
(i
,j
) - temp*wa
(i
)
93 c last card of subroutine qform.