From 57e2a72f40aaf008c48b7f0ec6e5216aee1499c4 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 17 Jan 2022 00:10:21 +0100 Subject: [PATCH] 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;