@@ -29,7 +29,7 @@ where φ(s ; xₖ) = f(xₖ) + ∇f(xₖ)ᵀs + ½ sᵀ(Dₖ + σₖI)s is a qua
2929* `x0::AbstractVector`: an initial guess (in the first calling form: default = `nlp.meta.x0`)
3030* `selected::AbstractVector{<:Integer}`: (default `1:length(x0)`).
3131* `D`: Diagonal quasi-Newton operator.
32- * `Mmonotone::Int`: number of previous values of the objective to consider for the non-monotone variant (default: 5 ).
32+ * `Mmonotone::Int`: number of previous values of the objective to consider for the non-monotone variant (default: 6 ).
3333
3434The objective and gradient of `nlp` will be accessed.
3535
@@ -87,7 +87,7 @@ function R2DH(
8787 D:: DQN ,
8888 options:: ROSolverOptions{R} ,
8989 x0:: AbstractVector{R} ;
90- Mmonotone:: Int = 5 ,
90+ Mmonotone:: Int = 6 ,
9191 selected:: AbstractVector{<:Integer} = 1 : length (x0),
9292 kwargs... ,
9393) where {F <: Function , G <: Function , H, R <: Real , DQN <: AbstractDiagonalQuasiNewtonOperator }
@@ -148,7 +148,7 @@ function R2DH(
148148 Fobj_hist = zeros (maxIter+ 1 )
149149 Hobj_hist = zeros (maxIter+ 1 )
150150 time_hist = zeros (maxIter+ 1 )
151- FHobj_hist = fill! (Vector {R} (undef, Mmonotone ), R (- Inf ))
151+ FHobj_hist = fill! (Vector {R} (undef, - 1 ), R (- Inf ))
152152 Complex_hist = zeros (Int, maxIter+ 1 )
153153 k_prox = 0
154154 if verbose > 0
@@ -202,7 +202,7 @@ function R2DH(
202202 Fobj_hist[k] = fk
203203 Hobj_hist[k] = hk
204204 time_hist[k] = elapsed_time
205- Mmonotone > 0 && (FHobj_hist[mod (k- 1 , Mmonotone) + 1 ] = fk + hk)
205+ Mmonotone > 1 && (FHobj_hist[mod (k- 1 , Mmonotone - 1 ) + 1 ] = fk + hk)
206206
207207 Complex_hist[k] += k_prox
208208 k_prox = 0
@@ -211,7 +211,7 @@ function R2DH(
211211 hkn = h (xkn[selected])
212212 hkn == - Inf && error (" nonsmooth term is not proper" )
213213
214- fhmax = Mmonotone > 0 ? maximum (FHobj_hist) : fk + hk
214+ fhmax = Mmonotone > 1 ? maximum (FHobj_hist) : fk + hk
215215 Δobj = fhmax - (fkn + hkn) + max (1 , abs (fhmax)) * 10 * eps ()
216216 Δmod = fhmax - (fk + mks) + max (1 , abs (hk)) * 10 * eps ()
217217 ξ = hk - mks + max (1 , abs (hk)) * 10 * eps ()
0 commit comments