Skip to content

Commit b9d8843

Browse files
authored
Replace multi-arg checksquare by map (#1380)
Following #559, this should reduce some unnecessary allocations in using the multi-argument `checksquare`.
1 parent c5d7122 commit b9d8843

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/lapack.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ for (geevx, ggev, ggev3, elty) in
21882188
function ggev!(jobvl::AbstractChar, jobvr::AbstractChar, A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty})
21892189
require_one_based_indexing(A, B)
21902190
chkstride1(A,B)
2191-
n, m = checksquare(A,B)
2191+
n, m = map(checksquare, (A, B))
21922192
if n != m
21932193
throw(DimensionMismatch(lazy"A has dimensions $(size(A)), and B has dimensions $(size(B)), but A and B must have the same size"))
21942194
end
@@ -2252,7 +2252,7 @@ for (geevx, ggev, ggev3, elty) in
22522252
function ggev3!(jobvl::AbstractChar, jobvr::AbstractChar, A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty})
22532253
require_one_based_indexing(A, B)
22542254
chkstride1(A,B)
2255-
n, m = checksquare(A,B)
2255+
n, m = map(checksquare, (A, B))
22562256
if n != m
22572257
throw(DimensionMismatch(lazy"A has dimensions $(size(A)), and B has dimensions $(size(B)), but A and B must have the same size"))
22582258
end
@@ -2403,7 +2403,7 @@ for (geevx, ggev, ggev3, elty, relty) in
24032403
function ggev!(jobvl::AbstractChar, jobvr::AbstractChar, A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty})
24042404
require_one_based_indexing(A, B)
24052405
chkstride1(A, B)
2406-
n, m = checksquare(A, B)
2406+
n, m = map(checksquare, (A, B))
24072407
if n != m
24082408
throw(DimensionMismatch(lazy"A has dimensions $(size(A)), and B has dimensions $(size(B)), but A and B must have the same size"))
24092409
end
@@ -2468,7 +2468,7 @@ for (geevx, ggev, ggev3, elty, relty) in
24682468
function ggev3!(jobvl::AbstractChar, jobvr::AbstractChar, A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty})
24692469
require_one_based_indexing(A, B)
24702470
chkstride1(A, B)
2471-
n, m = checksquare(A, B)
2471+
n, m = map(checksquare, (A, B))
24722472
if n != m
24732473
throw(DimensionMismatch(lazy"A has dimensions $(size(A)), and B has dimensions $(size(B)), but A and B must have the same size"))
24742474
end
@@ -5492,7 +5492,7 @@ for (syev, syevr, syevd, sygvd, elty) in
54925492
@chkvalidparam 2 jobz ('N', 'V')
54935493
chkuplo(uplo)
54945494
chkstride1(A, B)
5495-
n, m = checksquare(A, B)
5495+
n, m = map(checksquare, (A, B))
54965496
if n != m
54975497
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
54985498
end
@@ -5708,7 +5708,7 @@ for (syev, syevr, syevd, sygvd, elty, relty) in
57085708
chkstride1(A, B)
57095709
chkuplofinite(A, uplo)
57105710
chkuplofinite(B, uplo)
5711-
n, m = checksquare(A, B)
5711+
n, m = map(checksquare, (A, B))
57125712
if n != m
57135713
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
57145714
end
@@ -6485,7 +6485,7 @@ for (gees, gges, gges3, elty) in
64856485
@chkvalidparam 1 jobvsl ('N', 'V')
64866486
@chkvalidparam 2 jobvsr ('N', 'V')
64876487
chkstride1(A, B)
6488-
n, m = checksquare(A, B)
6488+
n, m = map(checksquare, (A, B))
64896489
if n != m
64906490
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
64916491
end
@@ -6537,7 +6537,7 @@ for (gees, gges, gges3, elty) in
65376537
@chkvalidparam 1 jobvsl ('N', 'V')
65386538
@chkvalidparam 2 jobvsr ('N', 'V')
65396539
chkstride1(A, B)
6540-
n, m = checksquare(A, B)
6540+
n, m = map(checksquare, (A, B))
65416541
if n != m
65426542
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
65436543
end
@@ -6637,7 +6637,7 @@ for (gees, gges, gges3, elty, relty) in
66376637
@chkvalidparam 1 jobvsl ('N', 'V')
66386638
@chkvalidparam 2 jobvsr ('N', 'V')
66396639
chkstride1(A, B)
6640-
n, m = checksquare(A, B)
6640+
n, m = map(checksquare, (A, B))
66416641
if n != m
66426642
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
66436643
end
@@ -6690,7 +6690,7 @@ for (gees, gges, gges3, elty, relty) in
66906690
@chkvalidparam 1 jobvsl ('N', 'V')
66916691
@chkvalidparam 2 jobvsr ('N', 'V')
66926692
chkstride1(A, B)
6693-
n, m = checksquare(A, B)
6693+
n, m = map(checksquare, (A, B))
66946694
if n != m
66956695
throw(DimensionMismatch(lazy"dimensions of A, ($n,$n), and B, ($m,$m), must match"))
66966696
end

0 commit comments

Comments
 (0)