Skip to content

Commit 4ebabc4

Browse files
Remove abstract typing of LowRankMatrix in v0.7
1 parent aeee7a5 commit 4ebabc4

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

src/LowRankMatrix.jl

+28-10
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,36 @@ threadsafeones(::Type{T}, n::Integer) where T = ThreadSafeVector{T}(ones(T, n, T
1818

1919
abstract type AbstractLowRankMatrix{T} <: AbstractMatrix{T} end
2020

21-
"""
22-
Store the singular value decomposition of a matrix:
21+
if VERSION < v"0.7-"
22+
"""
23+
Store the singular value decomposition of a matrix:
24+
25+
A = UΣV'
26+
27+
"""
28+
struct LowRankMatrix{T} <: AbstractLowRankMatrix{T}
29+
U::Matrix{T}
30+
Σ::Diagonal{T}
31+
V::Matrix{T}
32+
temp::ThreadSafeVector{T}
33+
end
34+
else
35+
"""
36+
Store the singular value decomposition of a matrix:
37+
38+
A = UΣV'
39+
40+
"""
41+
struct LowRankMatrix{T} <: AbstractLowRankMatrix{T}
42+
U::Matrix{T}
43+
Σ::Diagonal{T, Vector{T}}
44+
V::Matrix{T}
45+
temp::ThreadSafeVector{T}
46+
end
47+
end
48+
2349

24-
A = UΣV'
2550

26-
"""
27-
struct LowRankMatrix{T} <: AbstractLowRankMatrix{T}
28-
U::Matrix{T}
29-
Σ::Diagonal{T}
30-
V::Matrix{T}
31-
temp::ThreadSafeVector{T}
32-
end
3351

3452
LowRankMatrix(U::Matrix{T}, Σ::Diagonal{T}, V::Matrix{T}) where T = LowRankMatrix(U, Σ, V, threadsafezeros(T, length.diag)))
3553

0 commit comments

Comments
 (0)