Skip to content

Commit a0d2d27

Browse files
committed
Fix interfaces and typo
1 parent eafe231 commit a0d2d27

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/qr.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_thin_must_hold(thin) =
1+
_thin_must_hold(thin) =
22
thin || throw(ArgumentError("For the sake of type stability, `thin = true` must hold."))
33
import Base.qr
44

@@ -7,15 +7,18 @@ import Base.qr
77
qr(A::StaticMatrix, pivot=Val{false}; thin=true) -> Q, R, [p]
88
99
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.
1212
"""
1313
@inline function qr(A::StaticMatrix, pivot::Union{Type{Val{false}}, Type{Val{true}}} = Val{false}; thin::Bool=true)
1414
_thin_must_hold(thin)
1515
return _qr(Size(A), A, pivot, Val{true})
1616
end
1717

1818

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+
1922
@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}
2023

2124
isthin = thin <: Type{Val{true}}
@@ -58,7 +61,7 @@ end
5861
# in the case of `thin=false` Q is full, but R is still reduced, see [`qr`](@ref).
5962
#
6063
# 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}
6265
m, n = sA[1], sA[2]
6366

6467
Q = [Symbol("Q_$(i)_$(j)") for i = 1:m, j = 1:m]

test/qr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ srand(42)
2727
@test istriu(R)
2828

2929
# fat (thin=false) case
30-
QR = @inferred StaticArrays._qr(Size(arr), arr, Val{false}, Val{false})
30+
QR = @inferred qr(arr, Val{false}, Val{false})
3131
@test QR isa Tuple
3232
@test length(QR) == 2
3333
Q, R = QR

0 commit comments

Comments
 (0)