Skip to content

Commit 1ee0282

Browse files
committed
LAPACK: Fixed ld_ for both tgsen and trsen, so that the stride LAPACK sees is alright for subarrays.
1 parent 9987d9e commit 1ee0282

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

base/linalg/lapack.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -3556,7 +3556,8 @@ for (trsen, tgsen, elty) in
35563556
# DOUBLE PRECISION Q( LDQ, * ), T( LDT, * ), WI( * ), WORK( * ), WR( * )
35573557
chkstride1(T, Q)
35583558
n = chksquare(T)
3559-
ld = max(1, n)
3559+
ldt = max(1, stride(T, 2))
3560+
ldq = max(1, stride(Q, 2))
35603561
wr = similar(T, $elty, n)
35613562
wi = similar(T, $elty, n)
35623563
m = sum(select)
@@ -3575,7 +3576,7 @@ for (trsen, tgsen, elty) in
35753576
Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt},
35763577
Ptr{BlasInt}),
35773578
&'N', &'V', select, &n,
3578-
T, &ld, Q, &ld,
3579+
T, &ldt, Q, &ldq,
35793580
wr, wi, &m, C_NULL, C_NULL,
35803581
work, &lwork, iwork, &liwork,
35813582
info)
@@ -3666,7 +3667,8 @@ for (trsen, tgsen, elty) in
36663667
# COMPLEX Q( LDQ, * ), T( LDT, * ), W( * ), WORK( * )
36673668
chkstride1(T, Q)
36683669
n = chksquare(T)
3669-
ld = max(1, n)
3670+
ldt = max(1, stride(T, 2))
3671+
ldq = max(1, stride(Q, 2))
36703672
w = similar(T, $elty, n)
36713673
m = sum(select)
36723674
work = Array($elty, 1)
@@ -3682,7 +3684,7 @@ for (trsen, tgsen, elty) in
36823684
Ptr{$elty}, Ptr {BlasInt},
36833685
Ptr{BlasInt}),
36843686
&'N', &'V', select, &n,
3685-
T, &ld, Q, &ld,
3687+
T, &ldt, Q, &ldq,
36863688
w, &m, C_NULL, C_NULL,
36873689
work, &lwork,
36883690
info)

0 commit comments

Comments
 (0)