File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1190,6 +1190,8 @@ end
11901190# would turn into inv(A)^1 = copy(inv(A)), which makes an extra copy.
11911191@inline Base. literal_pow (:: typeof (^ ), A:: AbstractMatrix , :: Val{-1} ) = inv (A)
11921192
1193+ _maybecopy (A:: AbstractArray{T} , :: Type{T} ) where {T} = A
1194+ _maybecopy (A, :: Type{T} ) where {T} = copy_oftype (A, T)
11931195"""
11941196 \\ (A, B)
11951197
@@ -1236,9 +1238,9 @@ function (\)(A::AbstractMatrix, B::AbstractVecOrMat)
12361238 if istriu (A)
12371239 return UpperTriangular (A) \ B
12381240 end
1239- return _lu ( _lucopy (A, T)) \ B
1241+ return lu ( _maybecopy (A, T)) \ B
12401242 end
1241- return _qr ( copy_similar (A, _qreltype (T) ), ColumnNorm ()) \ B
1243+ return qr ( _maybecopy (A, T ), ColumnNorm ()) \ B
12421244end
12431245
12441246(\ )(a:: AbstractVector , b:: AbstractArray ) = pinv (a) * b
You can’t perform that action at this time.
0 commit comments