-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdecompositions.jl
More file actions
206 lines (162 loc) · 6.53 KB
/
decompositions.jl
File metadata and controls
206 lines (162 loc) · 6.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# TODO: module Decompositions?
# =================
# LAPACK ALGORITHMS
# =================
# reference for naming LAPACK algorithms:
# https://www.netlib.org/lapack/explore-html/topics.html
# QR, LQ, QL, RQ Decomposition
# ----------------------------
"""
LAPACK_HouseholderQR(; blocksize, positive = false, pivoted = false)
Algorithm type to denote the standard LAPACK algorithm for computing the QR decomposition of
a matrix using Householder reflectors. The specific LAPACK function can be controlled using
the keyword arugments, i.e. `?geqrt` will be chosen if `blocksize > 1`. With
`blocksize == 1`, `?geqrf` will be chosen if `pivoted == false` and `?geqp3` will be chosen
if `pivoted == true`. The keyword `positive=true` can be used to ensure that the diagonal
elements of `R` are non-negative.
"""
@algdef LAPACK_HouseholderQR
"""
LAPACK_HouseholderLQ(; blocksize, positive = false)
Algorithm type to denote the standard LAPACK algorithm for computing the LQ decomposition of
a matrix using Householder reflectors. The specific LAPACK function can be controlled using
the keyword arugments, i.e. `?gelqt` will be chosen if `blocksize > 1` or `?gelqf` will be
chosen if `blocksize == 1`. The keyword `positive=true` can be used to ensure that the diagonal
elements of `L` are non-negative.
"""
@algdef LAPACK_HouseholderLQ
# TODO:
@algdef LAPACK_HouseholderQL
@algdef LAPACK_HouseholderRQ
# General Eigenvalue Decomposition
# -------------------------------
"""
LAPACK_Simple()
Algorithm type to denote the simple LAPACK driver for computing the Schur or non-Hermitian
eigenvalue decomposition of a matrix.
"""
@algdef LAPACK_Simple
"""
LAPACK_Expert()
Algorithm type to denote the expert LAPACK driver for computing the Schur or non-Hermitian
eigenvalue decomposition of a matrix.
"""
@algdef LAPACK_Expert
const LAPACK_EigAlgorithm = Union{LAPACK_Simple,LAPACK_Expert}
# Hermitian Eigenvalue Decomposition
# ----------------------------------
"""
LAPACK_QRIteration()
Algorithm type to denote the LAPACK driver for computing the eigenvalue decomposition of a
Hermitian matrix, or the singular value decomposition of a general matrix using the
QR Iteration algorithm.
"""
@algdef LAPACK_QRIteration
"""
LAPACK_Bisection()
Algorithm type to denote the LAPACK driver for computing the eigenvalue decomposition of a
Hermitian matrix, or the singular value decomposition of a general matrix using the
Bisection algorithm.
"""
@algdef LAPACK_Bisection
"""
LAPACK_DivideAndConquer()
Algorithm type to denote the LAPACK driver for computing the eigenvalue decomposition of a
Hermitian matrix, or the singular value decomposition of a general matrix using the
Divide and Conquer algorithm.
"""
@algdef LAPACK_DivideAndConquer
"""
LAPACK_MultipleRelativelyRobustRepresentations()
Algorithm type to denote the LAPACK driver for computing the eigenvalue decomposition of a
Hermitian matrix using the Multiple Relatively Robust Representations algorithm.
"""
@algdef LAPACK_MultipleRelativelyRobustRepresentations
const LAPACK_EighAlgorithm = Union{LAPACK_QRIteration,
LAPACK_Bisection,
LAPACK_DivideAndConquer,
LAPACK_MultipleRelativelyRobustRepresentations}
# Singular Value Decomposition
# ----------------------------
"""
LAPACK_Jacobi()
Algorithm type to denote the LAPACK driver for computing the singular value decomposition of
a general matrix using the Jacobi algorithm.
"""
@algdef LAPACK_Jacobi
const LAPACK_SVDAlgorithm = Union{LAPACK_QRIteration,
LAPACK_Bisection,
LAPACK_DivideAndConquer,
LAPACK_Jacobi}
# =========================
# CUSOLVER ALGORITHMS
# =========================
"""
CUSOLVER_HouseholderQR(; positive = false)
Algorithm type to denote the standard CUSOLVER algorithm for computing the QR decomposition of
a matrix using Householder reflectors. The keyword `positive=true` can be used to ensure that
the diagonal elements of `R` are non-negative.
"""
@algdef CUSOLVER_HouseholderQR
"""
CUSOLVER_QRIteration()
Algorithm type to denote the CUSOLVER driver for computing the eigenvalue decomposition of a
Hermitian matrix, or the singular value decomposition of a general matrix using the
QR Iteration algorithm.
"""
@algdef CUSOLVER_QRIteration
"""
CUSOLVER_SVDPolar()
Algorithm type to denote the CUSOLVER driver for computing the singular value decomposition of
a general matrix by using Halley's iterative algorithm to compute the polar decompositon,
followed by the hermitian eigenvalue decomposition of the positive definite factor.
"""
@algdef CUSOLVER_SVDPolar
"""
CUSOLVER_Jacobi()
Algorithm type to denote the CUSOLVER driver for computing the singular value decomposition of
a general matrix using the Jacobi algorithm.
"""
@algdef CUSOLVER_Jacobi
"""
CUSOLVER_Randomized(; p, niters)
Algorithm type to denote the CUSOLVER driver for computing the singular value decomposition of
a general matrix using the randomized SVD algorithm.
!!! note
Randomized SVD cannot compute all singular values of the input matrix `A`, only the first `k` where
`k < min(m, n)`. The remainder are used for oversampling. See the [CUSOLVER documentation](https://docs.nvidia.com/cuda/cusolver/index.html#cusolverdnxgesvdr)
for more information.
"""
@algdef CUSOLVER_Randomized
"""
CUSOLVER_Simple()
Algorithm type to denote the simple CUSOLVER driver for computing the non-Hermitian
eigenvalue decomposition of a matrix.
"""
@algdef CUSOLVER_Simple
const CUSOLVER_EigAlgorithm = Union{CUSOLVER_Simple}
# =========================
# ROCSOLVER ALGORITHMS
# =========================
"""
ROCSOLVER_HouseholderQR(; positive = false)
Algorithm type to denote the standard ROCSOLVER algorithm for computing the QR decomposition of
a matrix using Householder reflectors. The keyword `positive=true` can be used to ensure that
the diagonal elements of `R` are non-negative.
"""
@algdef ROCSOLVER_HouseholderQR
"""
ROCSOLVER_QRIteration()
Algorithm type to denote the ROCSOLVER driver for computing the eigenvalue decomposition of a
Hermitian matrix, or the singular value decomposition of a general matrix using the
QR Iteration algorithm.
"""
@algdef ROCSOLVER_QRIteration
"""
ROCSOLVER_Jacobi()
Algorithm type to denote the ROCSOLVER driver for computing the singular value decomposition of
a general matrix using the Jacobi algorithm.
"""
@algdef ROCSOLVER_Jacobi
const GPU_Simple = Union{CUSOLVER_Simple}
const GPU_EigAlgorithm = Union{GPU_Simple}