We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d2070b commit f40c141Copy full SHA for f40c141
src/implementations/svd.jl
@@ -227,15 +227,15 @@ function svd_trunc!(A, USVᴴϵ::Tuple{Nothing, Tϵ}, alg::TruncatedAlgorithm) w
227
end
228
229
function svd_trunc!(A, USVᴴ::Tuple{TU, TS, TVᴴ}, alg::TruncatedAlgorithm; compute_error::Bool = true) where {TU, TS, TVᴴ}
230
- ϵ = similar(S, compute_error)
+ ϵ = similar(USVᴴ[2], compute_error)
231
(U, S, Vᴴ, ϵ) = svd_trunc!(A, (USVᴴ..., ϵ), alg)
232
return compute_error ? (U, S, Vᴴ, ϵ[1]) : (U, S, Vᴴ, -one(eltype(ϵ)))
233
234
function svd_trunc!(A, USVᴴ::Nothing, alg::TruncatedAlgorithm; compute_error::Bool = true)
235
Tr = real(eltype(A))
236
ϵ = compute_error ? zeros(Tr, 1) : zeros(Tr, 0)
237
U, S, Vᴴ, ϵ = svd_trunc!(A, (USVᴴ, ϵ), alg)
238
- return compute_error ? (U, S, Vᴴ, ϵ[1]::Tr) : (U, S, Vᴴ, -one(Tr))
+ return compute_error ? (U, S, Vᴴ, ϵ[1]) : (U, S, Vᴴ, -one(Tr))
239
240
241
# Diagonal logic
0 commit comments