@@ -4,15 +4,20 @@ mutable struct DummySolver{T} <: AbstractOptSolver{T}
44 workspace
55end
66
7+ SolverCore. problem_types_handled (:: Type{DummySolver} ) = [:unc , :bnd , :equ , :bndequ , :ineq , :genopt ]
8+
79function SolverCore. parameters (:: Type{DummySolver{T}} ) where T
810 (
911 α = (default= T (1e-2 ), type= :log , min= √√ eps (T), max= one (T) / 2 ),
12+ β = (default= T (1e-2 ), type= :log , min= √√ eps (T), max= one (T) / 2 ),
1013 δ = (default= √ eps (T), type= :log , min= √ eps (T), max= √√√ eps (T)),
1114 reboot_y = (default= false , type= :bool ),
1215 )
1316end
1417
15- # function for validating given parameters. Instead of using constraints.
18+ function SolverCore. are_valid_parameters (:: Type{DummySolver} , α, β, δ, reboot_y)
19+ return α + β ≤ 0.5
20+ end
1621
1722function DummySolver (:: Type{T} , meta :: AbstractNLPModelMeta ; kwargs... ) where T
1823 nvar, ncon = meta. nvar, meta. ncon
@@ -50,6 +55,7 @@ function SolverCore.solve!(solver::DummySolver{T}, nlp :: AbstractNLPModel;
5055 solver. params[k] = v
5156 end
5257 α = solver. params[:α ]
58+ β = solver. params[:β ]
5359 δ = solver. params[:δ ]
5460 reboot_y = solver. params[:reboot_y ]
5561
@@ -96,7 +102,7 @@ function SolverCore.solve!(solver::DummySolver{T}, nlp :: AbstractNLPModel;
96102 ft = obj (nlp, xt)
97103 slope = - dot (Δx, Hxy, Δx) - norm (AΔx)^ 2 / δ
98104 t = 1.0
99- while ! (ϕ (ft, ct, y) ≤ ϕx + α * t * slope)
105+ while ! (ϕ (ft, ct, y) ≤ ϕx + (α + β) * t * slope)
100106 t /= 2
101107 xt .= x + t * Δx
102108 if ncon > 0
0 commit comments