Skip to content

Commit bef96b4

Browse files
committed
Redo "undo changes to copytrito!"
1 parent 72e5cc8 commit bef96b4

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/generic.jl

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,29 +2079,21 @@ function copytrito!(B::AbstractMatrix, A::AbstractMatrix, uplo::AbstractChar)
20792079
A = Base.unalias(B, A)
20802080
if uplo == 'U'
20812081
LAPACK.lacpy_size_check(size(B), (n < m ? n : m, n))
2082-
copytrito_upper!(B, A)
2082+
# extract the parents for UpperTriangular matrices
2083+
Bv, Av = uppertridata(B), uppertridata(A)
2084+
for j in axes(A,2), i in axes(A,1)[begin : min(j,end)]
2085+
@inbounds Bv[i,j] = Av[i,j]
2086+
end
20832087
else # uplo == 'L'
20842088
LAPACK.lacpy_size_check(size(B), (m, m < n ? m : n))
2085-
copytrito_lower!(B, A)
2089+
# extract the parents for LowerTriangular matrices
2090+
Bv, Av = lowertridata(B), lowertridata(A)
2091+
for j in axes(A,2), i in axes(A,1)[j:end]
2092+
@inbounds Bv[i,j] = Av[i,j]
2093+
end
20862094
end
20872095
return B
20882096
end
2089-
@inline function copytrito_upper!(B, A)
2090-
# extract the parents for UpperTriangular matrices
2091-
Bv, Av = uppertridata(B), uppertridata(A)
2092-
for j in axes(A,2), i in axes(A,1)[begin : min(j,end)]
2093-
@inbounds Bv[i,j] = Av[i,j]
2094-
end
2095-
B
2096-
end
2097-
@inline function copytrito_lower!(B, A)
2098-
# extract the parents for LowerTriangular matrices
2099-
Bv, Av = lowertridata(B), lowertridata(A)
2100-
for j in axes(A,2), i in axes(A,1)[j:end]
2101-
@inbounds Bv[i,j] = Av[i,j]
2102-
end
2103-
B
2104-
end
21052097
# Forward LAPACK-compatible strided matrices to lacpy
21062098
function copytrito!(B::StridedMatrixStride1{T}, A::StridedMatrixStride1{T}, uplo::AbstractChar) where {T<:BlasFloat}
21072099
LAPACK.lacpy!(B, A, uplo)

0 commit comments

Comments
 (0)