1
- * {SIGMA/xGESVDQ/dgesvdq.f}
2
1
*
3
2
* Definition:
4
3
* ===========
68
67
* JOBR (input)
69
68
* JOBR is CHARACTER*1
70
69
* = 'T' After the initial pivoted QR factorization, DGESVD is applied to
71
- * the transposed R**T of the computed trinagular factor R. This involves
70
+ * the transposed R**T of the computed triangular factor R. This involves
72
71
* some extra data movement (matrix transpositions). Useful for
73
72
* experiments, research and development.
74
73
* = 'N' The triangular factor R is given as input to DGESVD. This may be
109
108
* A (input/workspace/output)
110
109
* A is REAL array of dimensions LDA x N
111
110
* On entry, the input matrix A.
112
- * On exit, if JOBU .NE. 'N' o JOBV .NE. 'N', the lower triangle of A contains
113
- * the Householder vectorsas stored by DGEQP3. If JOBU = 'F', these Househlder
111
+ * On exit, if JOBU .NE. 'N' or JOBV .NE. 'N', the lower triangle of A contains
112
+ * the Householder vectors as stored by DGEQP3. If JOBU = 'F', these Householder
114
113
* vectors together with WORK(1:N) can be used to restore the Q factors from
115
114
* the initial pivoted QR factorization of A. See the description of U.
116
115
* ..............................................................................
233
232
* if the full SVD is requested with JOBV='A' or 'V', and
234
233
* JOBR ='T', and also a scaled condition number estimate
235
234
* requested.
236
- * Finally, LWORK must be at lest two: LWORK = MAX( 2, LWORK ).
235
+ * Finally, LWORK must be at least two: LWORK = MAX( 2, LWORK ).
237
236
* If, on entry, LWORK = -1, (workspace query) then the optimal and the
238
237
* minimal length of WORK are computed and returned in the first two entries
239
238
* of WORK. See the description of WORK.
272
271
* DO-loops because BLAS and LAPACK do not provide corresponding subroutines.
273
272
* Those DO-loops are easily identified in this source code - by the CONTINUE
274
273
* statements labeled wit 11**. In an optimized version of this code, the
275
- * nested DO loops should be replaced with calls to an optimized subrotine .
274
+ * nested DO loops should be replaced with calls to an optimized subroutine .
276
275
* 2. This code scales A by 1/SQRT(M) if the largest ABS(A(i,j)) could cause
277
276
* column norm overflow. This is the minial precaution and it is left to the
278
277
* SVD routine (DGESVD) to do its own preemptive scaling if potential over-
@@ -402,7 +401,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
402
401
* [[The expressions for computing the minimal and the optimal
403
402
* values of LWORK are written with a lot of redundancy and
404
403
* can be simplified. However, this detailed form is easier for
405
- * maintenace and modififactions of the code.]]
404
+ * maintenance and modifications of the code.]]
406
405
*
407
406
* .. minimal workspace length for DGEQP3 of an M x N matrix
408
407
LWQP3 = 3 * N + 1
@@ -435,7 +434,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
435
434
MINWRK = 2
436
435
OPTWRK = 2
437
436
IF ( .NOT. (LSVEC .OR. RSVEC )) THEN
438
- * .. minimal and optimal sizes of the workspace if
437
+ * .. minimal and optimal sizes of the workspace if
439
438
* only the singular values are requested
440
439
IF ( CONDA ) THEN
441
440
MINWRK = MAX ( N+ LWQP3, LWCON, LWSVD )
@@ -478,7 +477,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
478
477
END IF
479
478
END IF
480
479
ELSE IF ( RSVEC .AND. (.NOT. LSVEC) ) THEN
481
- * .. minimal and optimal sizes of the workspace if the
480
+ * .. minimal and optimal sizes of the workspace if the
482
481
* singular values and the right singular vectors are requested
483
482
IF ( CONDA ) THEN
484
483
MINWRK = N + MAX ( LWQP3, LWCON, LWSVD )
@@ -501,7 +500,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
501
500
END IF
502
501
END IF
503
502
ELSE
504
- * .. minimal and optimal sizes of the workspace if the
503
+ * .. minimal and optimal sizes of the workspace if the
505
504
* full SVD is requested
506
505
IF ( RTRANS ) THEN
507
506
MINWRK = MAX ( LWQP3, LWSVD, LWORQ )
@@ -524,7 +523,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
524
523
IF ( CONDA ) MINWRK = MAX ( MINWRK, LWCON )
525
524
MINWRK = MINWRK + N
526
525
IF ( WNTVA ) THEN
527
- * .. minimal workspace length for N/2 x N DGELQF
526
+ * .. minimal workspace length for N/2 x N DGELQF
528
527
LWLQF = MAX ( N/ 2 , 1 )
529
528
LWSVD2 = MAX ( 5 * (N/ 2 ), 1 )
530
529
LWORLQ = MAX ( N , 1 )
@@ -675,9 +674,9 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
675
674
CALL DLASWP( N, A, LDA, 1 , M-1 , IWORK(N+1 ), 1 )
676
675
END IF
677
676
*
678
- * .. At this stage, preemptive scaling is done only to avoid column
679
- * norms overflows during the QR factorization. The SVD procedure should
680
- * have its own scaling to save the singular values from overlows and
677
+ * .. At this stage, preemptive scaling is done only to avoid column
678
+ * norms overflows during the QR factorization. The SVD procedure should
679
+ * have its own scaling to save the singular values from overflows and
681
680
* underflows. That depends on the SVD procedure.
682
681
*
683
682
IF ( .NOT. ROWPRM ) THEN
@@ -714,7 +713,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
714
713
*
715
714
EPSLN = DLAMCH(' E' )
716
715
SFMIN = DLAMCH(' S' )
717
- * SMALL = SFMIN / EPSLN
716
+ * SMALL = SFMIN / EPSLN
718
717
NR = N
719
718
*
720
719
IF ( ACCLA ) THEN
@@ -734,7 +733,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
734
733
ELSEIF ( ACCLM ) THEN
735
734
* .. similarly as above, only slightly more gentle (less agressive).
736
735
* Sudden drop on the diagonal of R is used as the criterion for being
737
- * close-to-rank-defficient . The threshold is set to EPSLN=DLAMCH('E').
736
+ * close-to-rank-deficient . The threshold is set to EPSLN=DLAMCH('E').
738
737
* [[This can be made more flexible by replacing this hard-coded value
739
738
* with a user specified threshold.]] Also, the values that underflow
740
739
* will be truncated.
@@ -759,7 +758,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
759
758
3502 CONTINUE
760
759
*
761
760
IF ( CONDA ) THEN
762
- * Estimate the scled condition number of A. Use the fact that it is
761
+ * Estimate the scaled condition number of A. Use the fact that it is
763
762
* the same as the scaled condition number of R.
764
763
* .. V is used as workspace
765
764
CALL DLACPY( ' U' , N, N, A, LDA, V, LDV )
@@ -782,7 +781,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
782
781
SCONDA = ONE / SQRT (RTMP)
783
782
* For NR=N, SCONDA is an estimate of SQRT(||(R^* * R)^(-1)||_1),
784
783
* N^(-1/4) * SCONDA <= ||R^(-1)||_2 <= N^(1/4) * SCONDA
785
- * See the references [1], [2] fo more details.
784
+ * See the references [1], [2] for more details.
786
785
END IF
787
786
*
788
787
ENDIF
@@ -927,7 +926,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
927
926
CALL DLAPMT( .FALSE. , NR, N, V, LDV, IWORK )
928
927
ELSE
929
928
* .. need all N right singular vectors and NR < N
930
- * [!] This is simple implemetation that augments [V](1:N,1:NR)
929
+ * [!] This is simple implementation that augments [V](1:N,1:NR)
931
930
* by padding a zero block. In the case NR << N, a more efficient
932
931
* way is to first use the QR factorization. For more details
933
932
* how to implement this, see the " FULL SVD " branch.
@@ -960,7 +959,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
960
959
* .. now [V](1:NR,1:N) contains V(1:N,1:NR)**T
961
960
ELSE
962
961
* .. need all N right singular vectors and NR < N
963
- * [!] This is simple implemetation that augments [V](1:NR,1:N)
962
+ * [!] This is simple implementation that augments [V](1:NR,1:N)
964
963
* by padding a zero block. In the case NR << N, a more efficient
965
964
* way is to first use the LQ factorization. For more details
966
965
* how to implement this, see the " FULL SVD " branch.
@@ -1231,7 +1230,7 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
1231
1230
4001 CONTINUE
1232
1231
4002 CONTINUE
1233
1232
*
1234
- * .. if numerical rank defficiency is detected, the truncated
1233
+ * .. if numerical rank deficiency is detected, the truncated
1235
1234
* singular values are set to zero.
1236
1235
IF ( NR .LT. N ) CALL DLASET( ' G' , N- NR,1 , ZERO,ZERO, S(NR+1 ), N )
1237
1236
* .. undo scaling; this may cause overflow in the largest singular
@@ -1241,12 +1240,10 @@ SUBROUTINE DGESVDQ( JOBA, JOBP, JOBR, JOBU, JOBV, M, N, A, LDA,
1241
1240
IF ( CONDA ) RWORK(1 ) = SCONDA
1242
1241
RWORK(2 ) = p - NR
1243
1242
* .. p-NR is the number of singular values that are computed as
1244
- * exact zeros in DGESVD() aplied to the (possibly truncated)
1243
+ * exact zeros in DGESVD() applied to the (possibly truncated)
1245
1244
* full row rank triangular (trapezoidal) factor of A.
1246
1245
NUMRANK = NR
1247
1246
*
1248
1247
RETURN
1249
1248
END
1250
1249
* .. end of DGESVDQ
1251
-
1252
-
0 commit comments