diff options
author | Vladimír Chalupecký <vladimir-ch@users.noreply.github.com> | 2016-12-02 01:40:45 +0900 |
---|---|---|
committer | Julien Langou <julien.langou@ucdenver.edu> | 2016-12-02 01:40:45 +0900 |
commit | 2ceda6db0f046b1b676030f9b6d92541e6222e3c (patch) | |
tree | be76a2dd05efffc8605c4008d4da4275e9fd3980 | |
parent | cad7bf5a44d6a69e4708a0f26a9d62c2e882caae (diff) |
Fixes #92: xLASWP: bug for negative INCX
Thanks to Vladimír Chalupecký for noticing quite an old bug in xLASWP. The bug
is fixed now. The cases for INCX = 1 and INCX = -1 were correct. It is not
clear whether any other cases would be useful. So the bug was never detected.
We might want to consider to (1) forbid any values for INCX but INCX = 1 and
INCX = -1, (2) and simplify the code and the subroutine description
accordingly. Comments welcome. Julien.
-rw-r--r-- | SRC/claswp.f | 12 | ||||
-rw-r--r-- | SRC/dlaswp.f | 12 | ||||
-rw-r--r-- | SRC/slaswp.f | 12 | ||||
-rw-r--r-- | SRC/zlaswp.f | 12 |
4 files changed, 24 insertions, 24 deletions
diff --git a/SRC/claswp.f b/SRC/claswp.f index 7c347781..bdafc0b7 100644 --- a/SRC/claswp.f +++ b/SRC/claswp.f @@ -71,15 +71,15 @@ *> \param[in] K2 *> \verbatim *> K2 is INTEGER -*> The last element of IPIV for which a row interchange will -*> be done. +*> (K2-K1+1) is the number of elements of IPIV for which a row +*> interchange will be done. *> \endverbatim *> *> \param[in] IPIV *> \verbatim -*> IPIV is INTEGER array, dimension (K2*abs(INCX)) -*> The vector of pivot indices. Only the elements in positions -*> K1 through K2 of IPIV are accessed. +*> IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX)) +*> The vector of pivot indices. Only the elements in positions +*> K1 through K1+(K2-K1)*INCX of IPIV are accessed. *> IPIV(K) = L implies rows K and L are to be interchanged. *> \endverbatim *> @@ -143,7 +143,7 @@ I2 = K2 INC = 1 ELSE IF( INCX.LT.0 ) THEN - IX0 = 1 + ( 1-K2 )*INCX + IX0 = K1 + ( K1-K2 )*INCX I1 = K2 I2 = K1 INC = -1 diff --git a/SRC/dlaswp.f b/SRC/dlaswp.f index 1f050dbf..4e4d3d9f 100644 --- a/SRC/dlaswp.f +++ b/SRC/dlaswp.f @@ -71,15 +71,15 @@ *> \param[in] K2 *> \verbatim *> K2 is INTEGER -*> The last element of IPIV for which a row interchange will -*> be done. +*> (K2-K1+1) is the number of elements of IPIV for which a row +*> interchange will be done. *> \endverbatim *> *> \param[in] IPIV *> \verbatim -*> IPIV is INTEGER array, dimension (K2*abs(INCX)) -*> The vector of pivot indices. Only the elements in positions -*> K1 through K2 of IPIV are accessed. +*> IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX)) +*> The vector of pivot indices. Only the elements in positions +*> K1 through K1+(K2-K1)*INCX of IPIV are accessed. *> IPIV(K) = L implies rows K and L are to be interchanged. *> \endverbatim *> @@ -143,7 +143,7 @@ I2 = K2 INC = 1 ELSE IF( INCX.LT.0 ) THEN - IX0 = 1 + ( 1-K2 )*INCX + IX0 = K1 + ( K1-K2 )*INCX I1 = K2 I2 = K1 INC = -1 diff --git a/SRC/slaswp.f b/SRC/slaswp.f index 5ea247bc..f3a16ff9 100644 --- a/SRC/slaswp.f +++ b/SRC/slaswp.f @@ -71,15 +71,15 @@ *> \param[in] K2 *> \verbatim *> K2 is INTEGER -*> The last element of IPIV for which a row interchange will -*> be done. +*> (K2-K1+1) is the number of elements of IPIV for which a row +*> interchange will be done. *> \endverbatim *> *> \param[in] IPIV *> \verbatim -*> IPIV is INTEGER array, dimension (K2*abs(INCX)) -*> The vector of pivot indices. Only the elements in positions -*> K1 through K2 of IPIV are accessed. +*> IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX)) +*> The vector of pivot indices. Only the elements in positions +*> K1 through K1+(K2-K1)*INCX of IPIV are accessed. *> IPIV(K) = L implies rows K and L are to be interchanged. *> \endverbatim *> @@ -143,7 +143,7 @@ I2 = K2 INC = 1 ELSE IF( INCX.LT.0 ) THEN - IX0 = 1 + ( 1-K2 )*INCX + IX0 = K1 + ( K1-K2 )*INCX I1 = K2 I2 = K1 INC = -1 diff --git a/SRC/zlaswp.f b/SRC/zlaswp.f index 82244efb..b695d944 100644 --- a/SRC/zlaswp.f +++ b/SRC/zlaswp.f @@ -71,15 +71,15 @@ *> \param[in] K2 *> \verbatim *> K2 is INTEGER -*> The last element of IPIV for which a row interchange will -*> be done. +*> (K2-K1+1) is the number of elements of IPIV for which a row +*> interchange will be done. *> \endverbatim *> *> \param[in] IPIV *> \verbatim -*> IPIV is INTEGER array, dimension (K2*abs(INCX)) -*> The vector of pivot indices. Only the elements in positions -*> K1 through K2 of IPIV are accessed. +*> IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX)) +*> The vector of pivot indices. Only the elements in positions +*> K1 through K1+(K2-K1)*INCX of IPIV are accessed. *> IPIV(K) = L implies rows K and L are to be interchanged. *> \endverbatim *> @@ -143,7 +143,7 @@ I2 = K2 INC = 1 ELSE IF( INCX.LT.0 ) THEN - IX0 = 1 + ( 1-K2 )*INCX + IX0 = K1 + ( K1-K2 )*INCX I1 = K2 I2 = K1 INC = -1 |