From 1b49ef8dcf6b01aecef30f804654d0efc97bc37a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:05:33 +0100 Subject: [PATCH 1/7] Fix pivot index for negative increments --- lapack/laswp/generic/laswp_k_1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/laswp_k_1.c b/lapack/laswp/generic/laswp_k_1.c index 88648cf29..556889291 100644 --- a/lapack/laswp/generic/laswp_k_1.c +++ b/lapack/laswp/generic/laswp_k_1.c @@ -57,10 +57,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT *a, BLASLONG a--; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From 0e9e9513067665ec0a505ed935c89752a60dbb81 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:06:41 +0100 Subject: [PATCH 2/7] Fix pivot offset calculation for negative incx --- lapack/laswp/generic/laswp_k_2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/laswp_k_2.c b/lapack/laswp/generic/laswp_k_2.c index 93b9a2c01..f76cd078f 100644 --- a/lapack/laswp/generic/laswp_k_2.c +++ b/lapack/laswp/generic/laswp_k_2.c @@ -59,10 +59,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT *a, BLASLONG a--; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From eca2f50b48a9941e2f3d2cd75fb699ace070f9cc Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:07:33 +0100 Subject: [PATCH 3/7] Fix pivot offset calculation for negative incx --- lapack/laswp/generic/laswp_k_4.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/laswp_k_4.c b/lapack/laswp/generic/laswp_k_4.c index 191a229a9..6520ed799 100644 --- a/lapack/laswp/generic/laswp_k_4.c +++ b/lapack/laswp/generic/laswp_k_4.c @@ -65,10 +65,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT *a, BLASLONG a--; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From afa0cece5cbca7ce9c749b3101ac36b15518508e Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:08:20 +0100 Subject: [PATCH 4/7] Fix pivot offset calculation for negative incx --- lapack/laswp/generic/laswp_k_8.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/laswp_k_8.c b/lapack/laswp/generic/laswp_k_8.c index 947941839..a7bf06817 100644 --- a/lapack/laswp/generic/laswp_k_8.c +++ b/lapack/laswp/generic/laswp_k_8.c @@ -78,10 +78,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT *a, BLASLONG a--; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From 3b6293f5a0e4371d81074ee0ebc19d173ca696ed Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:09:14 +0100 Subject: [PATCH 5/7] Fix offset calculation for negative incx --- lapack/laswp/generic/zlaswp_k_1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/zlaswp_k_1.c b/lapack/laswp/generic/zlaswp_k_1.c index d1204778a..42aaed528 100644 --- a/lapack/laswp/generic/zlaswp_k_1.c +++ b/lapack/laswp/generic/zlaswp_k_1.c @@ -59,10 +59,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT dummy4, lda *= 2; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From 57e2a72f40aaf008c48b7f0ec6e5216aee1499c4 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:10:21 +0100 Subject: [PATCH 6/7] Fix pivot offset calculation for negative incx --- lapack/laswp/generic/zlaswp_k_2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/zlaswp_k_2.c b/lapack/laswp/generic/zlaswp_k_2.c index c18ab4bee..1220870f8 100644 --- a/lapack/laswp/generic/zlaswp_k_2.c +++ b/lapack/laswp/generic/zlaswp_k_2.c @@ -60,10 +60,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT dummy4, lda *= 2; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0; From 40003f8edb9e5c529c1c12589f9e1b53f9ac8f2d Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:11:18 +0100 Subject: [PATCH 7/7] Fix pivot offset calculation for negative incx --- lapack/laswp/generic/zlaswp_k_4.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lapack/laswp/generic/zlaswp_k_4.c b/lapack/laswp/generic/zlaswp_k_4.c index 45e1bf01e..cc7e296e1 100644 --- a/lapack/laswp/generic/zlaswp_k_4.c +++ b/lapack/laswp/generic/zlaswp_k_4.c @@ -69,10 +69,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT dummy4, lda *= 2; k1 --; -#ifndef MINUS ipiv += k1; -#else - ipiv -= (k2 - 1) * incx; +#ifdef MINUS + ipiv -= (k2 - k1 - 1) * incx; #endif if (n <= 0) return 0;