Skip to content

Commit 441521f

Browse files
Update RegularizedOptimization.jl and utils.jl
Use alphabetical order for external dependencies and remove unused variables.
1 parent 47311cb commit 441521f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/RegularizedOptimization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module RegularizedOptimization
44
using LinearAlgebra, Logging, Printf
55

66
# external dependencies
7-
using ProximalOperators, Arpack
7+
using Arpack, ProximalOperators
88

99
# dependencies from us
1010
using LinearOperators,

src/utils.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ function opnorm_eig(B; max_attempts::Int = 3)
88
have_eig = false
99
attempt = 0
1010
λ = zero(eltype(B))
11-
success = false
1211
n = size(B, 1)
1312
nev = 1
1413
ncv = max(20, 2 * nev + 1)
@@ -18,19 +17,17 @@ function opnorm_eig(B; max_attempts::Int = 3)
1817
have_eig = nconv == 1
1918
if (have_eig)
2019
λ = abs(d[1])
21-
success = true
2220
else
2321
ncv = min(2 * ncv, n)
2422
end
2523
end
26-
return λ, success
24+
return λ, have_eig
2725
end
2826

2927
function opnorm_svd(J; max_attempts::Int = 3)
3028
have_svd = false
3129
attempt = 0
3230
σ = zero(eltype(J))
33-
success = false
3431
n = min(size(J)...)
3532
nsv = 1
3633
ncv = 10
@@ -40,12 +37,11 @@ function opnorm_svd(J; max_attempts::Int = 3)
4037
have_svd = nconv == 1
4138
if (have_svd)
4239
σ = maximum(s.S)
43-
success = true
4440
else
4541
ncv = min(2 * ncv, n)
4642
end
4743
end
48-
return σ, success
44+
return σ, have_svd
4945
end
5046

5147
ShiftedProximalOperators.iprox!(

0 commit comments

Comments
 (0)