Skip to content

Commit 1b49ef8

Browse files
authored
Fix pivot index for negative increments
1 parent 5188aed commit 1b49ef8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lapack/laswp/generic/laswp_k_1.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ int CNAME(BLASLONG n, BLASLONG k1, BLASLONG k2, FLOAT dummy1, FLOAT *a, BLASLONG
5757
a--;
5858
k1 --;
5959

60-
#ifndef MINUS
6160
ipiv += k1;
62-
#else
63-
ipiv -= (k2 - 1) * incx;
61+
#ifdef MINUS
62+
ipiv -= (k2 - k1 - 1) * incx;
6463
#endif
6564

6665
if (n <= 0) return 0;

0 commit comments

Comments
 (0)