You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/block_krylov_utils.jl
+103-1Lines changed: 103 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,7 @@ end
181
181
# Output :
182
182
# Q an n-by-k orthonormal matrix: QᴴQ = Iₖ
183
183
# R an k-by-k upper triangular matrix: QR = A
184
-
functionhouseholder(A::AbstractMatrix{FC}; compact::Bool=false) where FC <:FloatOrComplex
184
+
functionhouseholder(A::Matrix{FC}; compact::Bool=false) where FC <:FloatOrComplex
185
185
n, k =size(A)
186
186
Q =copy(A)
187
187
τ =zeros(FC, k)
@@ -197,3 +197,105 @@ function householder!(Q::AbstractMatrix{FC}, R::AbstractMatrix{FC}, τ::Abstract
197
197
!compact &&korgqr!(Q, τ)
198
198
return Q, R
199
199
end
200
+
201
+
functionhouseholder!(Q::AbstractMatrix{FC}, R::AbstractMatrix{FC}, τ::AbstractVector{FC}, buffer::AbstractVector{FC}; compact::Bool=false) where FC <:FloatOrComplex
202
+
n, k =size(Q)
203
+
kfill!(R, zero(FC))
204
+
kgeqrf!(Q, τ, buffer)
205
+
copy_triangle(Q, R, k)
206
+
!compact &&korgqr!(Q, τ, buffer)
207
+
return Q, R
208
+
end
209
+
210
+
for (Xgeqrf, Xorgqr, Xormqr, T) in ((:sgeqrf_, :sorgqr_, :sormqr_, :Float32 ),
211
+
(:dgeqrf_, :dorgqr_, :dormqr_, :Float64 ),
212
+
(:cgeqrf_, :cungqr_, :cunmqr_, :ComplexF32),
213
+
(:zgeqrf_, :zungqr_, :zunmqr_, :ComplexF64))
214
+
@evalbegin
215
+
function$Xgeqrf(m, n, a, lda, tau, work, lwork, info)
$Xormqr(side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork, 0)
289
+
returnnothing
290
+
end
291
+
end
292
+
end
293
+
294
+
kgeqrf!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.geqrf!(A, tau)
295
+
kgeqrf!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}, buffer::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.geqrf!(A, tau)
296
+
297
+
korgqr!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.orgqr!(A, tau)
298
+
korgqr!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}, buffer::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.orgqr!(A, tau)
299
+
300
+
kormqr!(side ::Char, trans ::Char, A ::AbstractMatrix{T}, tau ::AbstractVector{T}, C ::AbstractMatrix{T}) where T <:BLAS.BlasFloat= LAPACK.ormqr!(side, trans, A, tau, C)
301
+
kormqr!(side ::Char, trans ::Char, A ::AbstractMatrix{T}, tau ::AbstractVector{T}, C ::AbstractMatrix{T}, buffer::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.ormqr!(side, trans, A, tau, C)
Copy file name to clipboardExpand all lines: src/krylov_utils.jl
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -348,10 +348,6 @@ kfill!(x :: AbstractArray{T}, val :: T) where T <: FloatOrComplex = fill!(x, val
348
348
349
349
kref!(n, x, y, c, s) =reflect!(x, y, c, s)
350
350
351
-
kgeqrf!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.geqrf!(A, tau)
352
-
korgqr!(A ::AbstractMatrix{T}, tau ::AbstractVector{T}) where T <:BLAS.BlasFloat= LAPACK.orgqr!(A, tau)
353
-
kormqr!(side ::Char, trans ::Char, A ::AbstractMatrix{T}, tau ::AbstractVector{T}, C ::AbstractMatrix{T}) where T <:BLAS.BlasFloat= LAPACK.ormqr!(side, trans, A, tau, C)
0 commit comments