@@ -2079,21 +2079,29 @@ 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- # 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
2082+ copytrito_upper! (B, A)
20872083 else # uplo == 'L'
20882084 LAPACK. lacpy_size_check (size (B), (m, m < n ? m : n))
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
2085+ copytrito_lower! (B, A)
20942086 end
20952087 return B
20962088end
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
20972105# Forward LAPACK-compatible strided matrices to lacpy
20982106function copytrito! (B:: StridedMatrixStride1{T} , A:: StridedMatrixStride1{T} , uplo:: AbstractChar ) where {T<: BlasFloat }
20992107 LAPACK. lacpy! (B, A, uplo)
0 commit comments