Skip to content

Commit a56a3ab

Browse files
authored
Make computations of singular vectors work (JuliaLinearAlgebra#41)
* Make computations of singular vectors work * Set seed! in Cholesky tests
1 parent 69f39d0 commit a56a3ab

File tree

5 files changed

+314
-85
lines changed

5 files changed

+314
-85
lines changed

Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ uuid = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
44
[deps]
55
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
66
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
7+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
78
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/qr.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import LinearAlgebra: reflectorApply!
66
struct QR2{T,S<:AbstractMatrix{T},V<:AbstractVector{T}} <: Factorization{T}
77
factors::S
88
τ::V
9-
QR2{T,S,V}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S<:AbstractMatrix,V<:AbstractVector} =
9+
QR2{T,S,V}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S<:AbstractMatrix,V<:AbstractVector} =
1010
new(factors, τ)
1111
end
1212
QR2(factors::AbstractMatrix{T}, τ::Vector{T}) where {T} = QR2{T,typeof(factors)}(factors, τ)
@@ -20,14 +20,14 @@ size(F::QR2, i::Integer...) = size(F.factors, i...)
2020
throw(DimensionMismatch("reflector must have same length as second dimension of matrix"))
2121
end
2222
@inbounds begin
23-
for i = 1:m
23+
for i in 1:m
2424
Aiv = A[i, 1]
25-
for j = 2:n
25+
for j in 2:n
2626
Aiv += A[i, j]*x[j]
2727
end
2828
Aiv = Aiv*τ
2929
A[i, 1] -= Aiv
30-
for j = 2:n
30+
for j in 2:n
3131
A[i, j] -= Aiv*x[j]'
3232
end
3333
end

0 commit comments

Comments
 (0)