Skip to content

Commit 14d2196

Browse files
authored
remove lu_copy!
1 parent 7275637 commit 14d2196

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/lu.jl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,30 +105,16 @@ end
105105

106106
#reusing LU object
107107
#lu!(F::LU,A) should be dispatched on the type of matrix stored in the LU factorization.
108-
#but special care needs to be done in the HermOrSym case
109-
function _lu_copy!(A,x)
110-
copyto!(A, x)
111-
end
112-
113-
function lu_copy!(A,x::HermOrSym)
114-
copytri!(A.data, x.uplo, isa(x, Hermitian))
115-
@inbounds if isa(x, Hermitian) # realify diagonal
116-
for i in axes(x, 1)
117-
A[i,i] = x[i,i]
118-
end
119-
end
120-
return A
121-
end
122108

123109
function lu!(F::LU{<:Any,<:StridedMatrix{<:BlasFloat}}, A; check::Bool = true, allowsingular::Bool = false)
124-
lu_copy!(F.factors,A)
110+
copyto!(F.factors,A)
125111
lpt = LAPACK.getrf!(F.factors, F.ipiv; check)
126112
check && _check_lu_success(lpt[3], allowsingular)
127113
return F
128114
end
129115

130116
function lu!(F::LU{<:Any,<:AbstractMatrix}, A; check::Bool = true, allowsingular::Bool = false)
131-
lu_copy!(F.factors,A)
117+
copyto!(F.factors,A)
132118
generic_lufact!(F.factors, lupivottype(eltype(A)), F.ipiv; check, allowsingular)
133119
return F
134120
end

0 commit comments

Comments
 (0)