Skip to content

Commit d763256

Browse files
rethrow error if ncv = n
1 parent f368164 commit d763256

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function opnorm_eig(B; max_attempts::Int = 3)
3232
ncv = min(2 * ncv, n)
3333
end
3434
catch e
35-
if occursin("XYAUPD_Exception", string(e))
35+
if occursin("XYAUPD_Exception", string(e)) && ncv < n
3636
@warn "Arpack error: $e. Increasing NCV to $ncv and retrying."
3737
ncv = min(2 * ncv, n) # Increase NCV but don't exceed matrix size
3838
else
@@ -68,7 +68,7 @@ function opnorm_svd(J; max_attempts::Int = 3)
6868
ncv = min(2 * ncv, n)
6969
end
7070
catch e
71-
if occursin("XYAUPD_Exception", string(e))
71+
if occursin("XYAUPD_Exception", string(e)) && ncv < n
7272
@warn "Arpack error: $e. Increasing NCV to $ncv and retrying."
7373
ncv = min(2 * ncv, n) # Increase NCV but don't exceed matrix size
7474
else

0 commit comments

Comments
 (0)