1
- _thin_must_hold (thin) =
1
+ _thin_must_hold (thin) =
2
2
thin || throw (ArgumentError (" For the sake of type stability, `thin = true` must hold." ))
3
3
import Base. qr
4
4
@@ -7,15 +7,18 @@ import Base.qr
7
7
qr(A::StaticMatrix, pivot=Val{false}; thin=true) -> Q, R, [p]
8
8
9
9
Compute the QR factorization of `A` such that `A = Q*R` or `A[:,p] = Q*R`, see [`qr`](@ref).
10
- This function is not support `thin=false` keyword option due to type inference instability.
11
- To use this option call `StaticArrays._qr(Size(A), A, pivot, Val{false})` instead.
10
+ This function does not support `thin=false` keyword option due to type inference instability.
11
+ To use this option call `qr( A, pivot, Val{false})` instead.
12
12
"""
13
13
@inline function qr (A:: StaticMatrix , pivot:: Union{Type{Val{false}}, Type{Val{true}}} = Val{false }; thin:: Bool = true )
14
14
_thin_must_hold (thin)
15
15
return _qr (Size (A), A, pivot, Val{true })
16
16
end
17
17
18
18
19
+ @inline qr (A:: StaticMatrix , pivot:: Union{Type{Val{false}}, Type{Val{true}}} , thin:: Union{Type{Val{false}}, Type{Val{true}}} ) = _qr (Size (A), A, pivot, thin)
20
+
21
+
19
22
@generated function _qr (:: Size{sA} , A:: StaticMatrix{<:Any, <:Any, TA} , pivot:: Union{Type{Val{false}}, Type{Val{true}}} = Val{false }, thin:: Union{Type{Val{false}}, Type{Val{true}}} = Val{true }) where {sA, TA}
20
23
21
24
isthin = thin <: Type{Val{true}}
58
61
# in the case of `thin=false` Q is full, but R is still reduced, see [`qr`](@ref).
59
62
#
60
63
# For original source code see below.
61
- @generated function qr_unrolled (:: Size{sA} , A:: StaticMatrix{<:Any, <:Any, TA} , pivot:: Type{Val{false}} , thin:: Union{Type{Val{false}},Type{Val{true}}} = Val{true }) where {sA, TA}
64
+ @generated function qr_unrolled (:: Size{sA} , A:: StaticMatrix{<:Any, <:Any, TA} , pivot:: Type{Val{false}} , thin:: Union{Type{Val{false}}, Type{Val{true}}} = Val{true }) where {sA, TA}
62
65
m, n = sA[1 ], sA[2 ]
63
66
64
67
Q = [Symbol (" Q_$(i) _$(j) " ) for i = 1 : m, j = 1 : m]
0 commit comments