Skip to content

Commit 57e2a72

Browse files
authored
Fix pivot offset calculation for negative incx
1 parent 3b6293f commit 57e2a72

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lapack/laswp/generic/zlaswp_k_2.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT dummy4,
6060
lda *= 2;
6161
k1 --;
6262

63-
#ifndef MINUS
6463
ipiv += k1;
65-
#else
66-
ipiv -= (k2 - 1) * incx;
64+
#ifdef MINUS
65+
ipiv -= (k2 - k1 - 1) * incx;
6766
#endif
6867

6968
if (n <= 0) return 0;

0 commit comments

Comments
 (0)