Skip to content

Commit b034479

Browse files
Fix cutoff_last error for zero M
1 parent ff48249 commit b034479

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/bell_frank_wolfe.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function bell_frank_wolfe(
220220
# renormalise the inequality by its smallest element, neglecting entries orders of magnitude smaller than the maximum
221221
if cutoff_last > 0
222222
M[log.(abs.(M)) .< maximum(log.(abs.(M))) - cutoff_last] .= zero(TL)
223-
M ./= minimum(abs.(M[abs.(M) .> zero(TL)]))
223+
M ./= minimum(abs.(M[abs.(M) .> zero(TL)]); init = one(TL)) # init to avoid error for zero array
224224
end
225225
β = (FrankWolfe.fast_dot(M, ds) - FrankWolfe.fast_dot(M, ro)) / (FrankWolfe.fast_dot(M, rp) - FrankWolfe.fast_dot(M, ro)) # local/global max found by the LMO
226226
dual_gap = FrankWolfe.fast_dot(x - vp, x) - FrankWolfe.fast_dot(x - vp, ds)

0 commit comments

Comments
 (0)