diff --git a/Project.toml b/Project.toml index 8208c222..02f46a80 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,6 @@ author = ["Robert Baraldi and Dominique Orban max_attempts) - attempt += 1 - (d, nconv, niter, nmult, resid) = - eigs(B; nev = nev, ncv = ncv, which = :LM, ritzvec = false, check = 1) - have_eig = nconv == 1 - if (have_eig) - λ = abs(d[1]) - success = true - else - ncv = min(2 * ncv, n) - end - end - return λ, success -end - -function opnorm_svd(J; max_attempts::Int = 3) - have_svd = false - attempt = 0 - σ = zero(eltype(J)) - success = false - n = min(size(J)...) - nsv = 1 - ncv = 10 - while !(have_svd || attempt > max_attempts) - attempt += 1 - (s, nconv, niter, nmult, resid) = svds(J, nsv = nsv, ncv = ncv, ritzvec = false, check = 1) - have_svd = nconv == 1 - if (have_svd) - σ = maximum(s.S) - success = true - else - ncv = min(2 * ncv, n) - end - end - return σ, success + _, s, _ = tsvd(B) + return s[1] end