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 2c34bc4 commit 905647eCopy full SHA for 905647e
src/implementations/svd.jl
@@ -229,13 +229,13 @@ end
229
function svd_trunc!(A, USVᴴ::Tuple{TU, TS, TVᴴ}, alg::TruncatedAlgorithm; compute_error::Bool = true) where {TU, TS, TVᴴ}
230
ϵ = 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(ϵ)))
+ return compute_error ? (U, S, Vᴴ, collect(ϵ)[1]) : (U, S, Vᴴ, -one(eltype(ϵ)))
233
end
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)
+ ϵ = zeros(Tr, compute_error)
237
U, S, Vᴴ, ϵ = svd_trunc!(A, (USVᴴ, ϵ), alg)
238
- return compute_error ? (U, S, Vᴴ, ϵ[1]) : (U, S, Vᴴ, -one(Tr))
+ return compute_error ? (U, S, Vᴴ, collect(ϵ)[1]) : (U, S, Vᴴ, -one(Tr))
239
240
241
# Diagonal logic
0 commit comments