Skip to content

Commit

Permalink
add step_nc parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Jun 28, 2023
1 parent de0574a commit 2f7b28a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/spgbox_main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ function spgbox!(
m::Int=10,
vaux::VAux=VAux(x, (isnothing(func_only) ? fg!(similar(x), x) : func_only(x)), m=m),
iprint::Int=0,
project_x0::Bool=true
project_x0::Bool=true,
step_nc=100
) where {T}
# Adimentional variation of T (base Number type)
adT = typeof(one(T))
Expand Down Expand Up @@ -234,7 +235,7 @@ function spgbox!(
den = den + (xn[i] - x[i]) * (gn[i] - g[i]) / oneunit(T)
end
if den <= zero(T)
tspg = adT(100)
tspg = adT(step_nc)
else
tspg = max(min(adT(1.0e30), num / den), adT(1.0e-30))
end
Expand Down

0 comments on commit 2f7b28a

Please sign in to comment.