@@ -22,19 +22,33 @@ function lu(A::AbstractMatrix, pivot = Val(true), thread = Val(true); kwargs...)
22
22
return lu! (copy (A), normalize_pivot (pivot), thread; kwargs... )
23
23
end
24
24
25
- struct NotIPIV <: AbstractVector{BlasInt} len:: Int end
25
+ struct NotIPIV <: AbstractVector{BlasInt}
26
+ len:: Int
27
+ end
26
28
Base. size (A:: NotIPIV ) = (A. len,)
27
29
Base. getindex (:: NotIPIV , i:: Int ) = i
28
30
Base. view (:: NotIPIV , r:: AbstractUnitRange ) = NotIPIV (length (r))
29
31
init_pivot (:: Val{false} , minmn) = NotIPIV (minmn)
30
32
init_pivot (:: Val{true} , minmn) = Vector {BlasInt} (undef, minmn)
31
33
34
+ if isdefined (LinearAlgebra, :_ipiv_cols! )
35
+ function LinearAlgebra. _ipiv_cols! (:: LU{<:Any, <:Any, NotIPIV} , :: OrdinalRange ,
36
+ B:: StridedVecOrMat )
37
+ return B
38
+ end
39
+ end
40
+ if isdefined (LinearAlgebra, :_ipiv_rows! )
41
+ function LinearAlgebra. _ipiv_rows! (:: LU{<:Any, <:Any, NotIPIV} , :: OrdinalRange ,
42
+ B:: StridedVecOrMat )
43
+ return B
44
+ end
45
+ end
32
46
33
47
function lu! (A, pivot = Val (true ), thread = Val (true ); check = true , kwargs... )
34
48
m, n = size (A)
35
49
minmn = min (m, n)
36
50
# we want the type on both branches to match. When pivot = Val(false), we construct
37
- # a `NotIPIV`, which `LinearAlgebra.generic_lufact!` does not.
51
+ # a `NotIPIV`, which `LinearAlgebra.generic_lufact!` does not.
38
52
F = if pivot === Val (true ) && minmn < 10 # avx introduces small performance degradation
39
53
LinearAlgebra. generic_lufact! (A, to_stdlib_pivot (pivot); check = check)
40
54
else
102
116
# [AL AR]
103
117
AL = @view A[:, 1 : m]
104
118
AR = @view A[:, (m + 1 ): n]
105
- apply_permutation! (ipiv, AR, Val ( Thread))
106
- ldiv! (_unit_lower_triangular (AL), AR, Val ( Thread))
119
+ apply_permutation! (ipiv, AR, Val { Thread} ( ))
120
+ ldiv! (_unit_lower_triangular (AL), AR, Val { Thread} ( ))
107
121
end
108
122
info
109
123
end
0 commit comments