From c30a2531bb5ef843130c74ea31c32b58a39f4a84 Mon Sep 17 00:00:00 2001 From: Igor Zhuravlov Date: Wed, 29 Mar 2023 16:07:04 +1000 Subject: [PATCH 1/2] fix typos in documentation of GEJSV RWORK was mentioned as WORK --- SRC/cgejsv.f | 10 +++++----- SRC/zgejsv.f | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SRC/cgejsv.f b/SRC/cgejsv.f index 062ac182b1..51a6cee4e1 100644 --- a/SRC/cgejsv.f +++ b/SRC/cgejsv.f @@ -151,7 +151,7 @@ *> transposed A if A^* seems to be better with respect to convergence. *> If the matrix is not square, JOBT is ignored. *> The decision is based on two values of entropy over the adjoint -*> orbit of A^* * A. See the descriptions of WORK(6) and WORK(7). +*> orbit of A^* * A. See the descriptions of RWORK(6) and RWORK(7). *> = 'T': transpose if entropy test indicates possibly faster *> convergence of Jacobi process if A^* is taken as input. If A is *> replaced with A^*, then the row pivoting is included automatically. @@ -209,11 +209,11 @@ *> \verbatim *> SVA is REAL array, dimension (N) *> On exit, -*> - For WORK(1)/WORK(2) = ONE: The singular values of A. During the -*> computation SVA contains Euclidean column norms of the +*> - For RWORK(1)/RWORK(2) = ONE: The singular values of A. During +*> the computation SVA contains Euclidean column norms of the *> iterated matrices in the array A. -*> - For WORK(1) .NE. WORK(2): The singular values of A are -*> (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if +*> - For RWORK(1) .NE. RWORK(2): The singular values of A are +*> (RWORK(1)/RWORK(2)) * SVA(1:N). This factored form is used if *> sigma_max(A) overflows or if small singular values have been *> saved from underflow by scaling the input matrix A. *> - If JOBR='R' then some of the singular values may be returned diff --git a/SRC/zgejsv.f b/SRC/zgejsv.f index 5134ea8912..5fe899e50f 100644 --- a/SRC/zgejsv.f +++ b/SRC/zgejsv.f @@ -151,7 +151,7 @@ *> transposed A if A^* seems to be better with respect to convergence. *> If the matrix is not square, JOBT is ignored. *> The decision is based on two values of entropy over the adjoint -*> orbit of A^* * A. See the descriptions of WORK(6) and WORK(7). +*> orbit of A^* * A. See the descriptions of RWORK(6) and RWORK(7). *> = 'T': transpose if entropy test indicates possibly faster *> convergence of Jacobi process if A^* is taken as input. If A is *> replaced with A^*, then the row pivoting is included automatically. @@ -209,11 +209,11 @@ *> \verbatim *> SVA is DOUBLE PRECISION array, dimension (N) *> On exit, -*> - For WORK(1)/WORK(2) = ONE: The singular values of A. During the -*> computation SVA contains Euclidean column norms of the +*> - For RWORK(1)/RWORK(2) = ONE: The singular values of A. During +*> the computation SVA contains Euclidean column norms of the *> iterated matrices in the array A. -*> - For WORK(1) .NE. WORK(2): The singular values of A are -*> (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if +*> - For RWORK(1) .NE. RWORK(2): The singular values of A are +*> (RWORK(1)/RWORK(2)) * SVA(1:N). This factored form is used if *> sigma_max(A) overflows or if small singular values have been *> saved from underflow by scaling the input matrix A. *> - If JOBR='R' then some of the singular values may be returned From 1f0d9615f16227237d5e975592c03e2310a26235 Mon Sep 17 00:00:00 2001 From: Igor Zhuravlov Date: Wed, 29 Mar 2023 16:09:45 +1000 Subject: [PATCH 2/2] fix comments about workspace length Some subroutines use WORK(1) but declare WORK length pro rata N which could be equal to 0. --- SRC/cgbsvx.f | 2 +- SRC/cgesvx.f | 2 +- SRC/dgbsvx.f | 2 +- SRC/dgejsv.f | 2 +- SRC/dgesvx.f | 2 +- SRC/sgbsvx.f | 2 +- SRC/sgesvx.f | 2 +- SRC/zgbsvx.f | 2 +- SRC/zgesvx.f | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SRC/cgbsvx.f b/SRC/cgbsvx.f index 7b6770d20d..eaab5682c7 100644 --- a/SRC/cgbsvx.f +++ b/SRC/cgbsvx.f @@ -322,7 +322,7 @@ *> *> \param[out] RWORK *> \verbatim -*> RWORK is REAL array, dimension (N) +*> RWORK is REAL array, dimension (MAX(1,N)) *> On exit, RWORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If RWORK(1) is much less than 1, then the stability diff --git a/SRC/cgesvx.f b/SRC/cgesvx.f index 66c714bb1c..74a37e9a0e 100644 --- a/SRC/cgesvx.f +++ b/SRC/cgesvx.f @@ -302,7 +302,7 @@ *> *> \param[out] RWORK *> \verbatim -*> RWORK is REAL array, dimension (2*N) +*> RWORK is REAL array, dimension (MAX(1,2*N)) *> On exit, RWORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If RWORK(1) is much less than 1, then the stability diff --git a/SRC/dgbsvx.f b/SRC/dgbsvx.f index 030f28f0a6..0ee5eecb31 100644 --- a/SRC/dgbsvx.f +++ b/SRC/dgbsvx.f @@ -316,7 +316,7 @@ *> *> \param[out] WORK *> \verbatim -*> WORK is DOUBLE PRECISION array, dimension (3*N) +*> WORK is DOUBLE PRECISION array, dimension (MAX(1,3*N)) *> On exit, WORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If WORK(1) is much less than 1, then the stability diff --git a/SRC/dgejsv.f b/SRC/dgejsv.f index 83d16c30e1..ee769bb384 100644 --- a/SRC/dgejsv.f +++ b/SRC/dgejsv.f @@ -362,7 +362,7 @@ *> *> \param[out] IWORK *> \verbatim -*> IWORK is INTEGER array, dimension (M+3*N). +*> IWORK is INTEGER array, dimension (MAX(3,M+3*N)). *> On exit, *> IWORK(1) = the numerical rank determined after the initial *> QR factorization with pivoting. See the descriptions diff --git a/SRC/dgesvx.f b/SRC/dgesvx.f index 4dc1d83cfe..f787488dca 100644 --- a/SRC/dgesvx.f +++ b/SRC/dgesvx.f @@ -296,7 +296,7 @@ *> *> \param[out] WORK *> \verbatim -*> WORK is DOUBLE PRECISION array, dimension (4*N) +*> WORK is DOUBLE PRECISION array, dimension (MAX(1,4*N)) *> On exit, WORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If WORK(1) is much less than 1, then the stability diff --git a/SRC/sgbsvx.f b/SRC/sgbsvx.f index 40829a71b3..df3a721d93 100644 --- a/SRC/sgbsvx.f +++ b/SRC/sgbsvx.f @@ -316,7 +316,7 @@ *> *> \param[out] WORK *> \verbatim -*> WORK is REAL array, dimension (3*N) +*> WORK is REAL array, dimension (MAX(1,3*N)) *> On exit, WORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If WORK(1) is much less than 1, then the stability diff --git a/SRC/sgesvx.f b/SRC/sgesvx.f index 930b88c336..385e626cfd 100644 --- a/SRC/sgesvx.f +++ b/SRC/sgesvx.f @@ -296,7 +296,7 @@ *> *> \param[out] WORK *> \verbatim -*> WORK is REAL array, dimension (4*N) +*> WORK is REAL array, dimension (MAX(1,4*N)) *> On exit, WORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If WORK(1) is much less than 1, then the stability diff --git a/SRC/zgbsvx.f b/SRC/zgbsvx.f index b6be786631..871564a814 100644 --- a/SRC/zgbsvx.f +++ b/SRC/zgbsvx.f @@ -322,7 +322,7 @@ *> *> \param[out] RWORK *> \verbatim -*> RWORK is DOUBLE PRECISION array, dimension (N) +*> RWORK is DOUBLE PRECISION array, dimension (MAX(1,N)) *> On exit, RWORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If RWORK(1) is much less than 1, then the stability diff --git a/SRC/zgesvx.f b/SRC/zgesvx.f index 87f36bba6b..3b193a1b2a 100644 --- a/SRC/zgesvx.f +++ b/SRC/zgesvx.f @@ -302,7 +302,7 @@ *> *> \param[out] RWORK *> \verbatim -*> RWORK is DOUBLE PRECISION array, dimension (2*N) +*> RWORK is DOUBLE PRECISION array, dimension (MAX(1,2*N)) *> On exit, RWORK(1) contains the reciprocal pivot growth *> factor norm(A)/norm(U). The "max absolute element" norm is *> used. If RWORK(1) is much less than 1, then the stability