Skip to content

Commit

Permalink
Merge febbdfe into 69f39d0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Dec 15, 2018
2 parents 69f39d0 + febbdfe commit c0ebf60
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 85 deletions.
1 change: 1 addition & 0 deletions Project.toml
Expand Up @@ -4,4 +4,5 @@ uuid = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8 changes: 4 additions & 4 deletions src/qr.jl
Expand Up @@ -6,7 +6,7 @@ import LinearAlgebra: reflectorApply!
struct QR2{T,S<:AbstractMatrix{T},V<:AbstractVector{T}} <: Factorization{T}
factors::S
τ::V
QR2{T,S,V}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S<:AbstractMatrix,V<:AbstractVector} =
QR2{T,S,V}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S<:AbstractMatrix,V<:AbstractVector} =
new(factors, τ)
end
QR2(factors::AbstractMatrix{T}, τ::Vector{T}) where {T} = QR2{T,typeof(factors)}(factors, τ)
Expand All @@ -20,14 +20,14 @@ size(F::QR2, i::Integer...) = size(F.factors, i...)
throw(DimensionMismatch("reflector must have same length as second dimension of matrix"))
end
@inbounds begin
for i = 1:m
for i in 1:m
Aiv = A[i, 1]
for j = 2:n
for j in 2:n
Aiv += A[i, j]*x[j]
end
Aiv = Aiv*τ
A[i, 1] -= Aiv
for j = 2:n
for j in 2:n
A[i, j] -= Aiv*x[j]'
end
end
Expand Down

0 comments on commit c0ebf60

Please sign in to comment.