Skip to content

Commit

Permalink
set allevals instead of quick in linear operators counters
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed May 2, 2021
1 parent 6316457 commit adc3306
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/Stopping/LinearAlgebraStopping.jl
Expand Up @@ -184,13 +184,13 @@ end
"""
init\\_max\\_counters\\_linear\\_operators: counters for LinearOperator
`init_max_counters_linear_operators(;nprod :: Int = 20000, ntprod :: Int = 20000, nctprod :: Int = 20000, sum :: Int = 20000*11)`
`init_max_counters_linear_operators(; allevals :: T = 20000, nprod = allevals, ntprod = allevals, nctprod = allevals, sum = 11 * allevals)`
"""
function init_max_counters_linear_operators(; quick :: T = 20000,
nprod :: T = quick,
ntprod :: T = quick,
nctprod :: T = quick,
sum :: T = quick*11
function init_max_counters_linear_operators(; allevals :: T = 20000,
nprod :: T = allevals,
ntprod :: T = allevals,
nctprod :: T = allevals,
sum :: T = allevals * 11
) where T <: Int

cntrs = Dict{Symbol,T}([(:nprod, nprod),
Expand Down
2 changes: 1 addition & 1 deletion src/Stopping/NLPStoppingmod.jl
Expand Up @@ -131,7 +131,7 @@ end
"""
init\\_max\\_counters:
initialize the maximum number of evaluations on each of
the functions present in the `NLPModels.Counters`, e.g.
the functions present in the NLPModels.Counters, e.g.
`init_max_counters(; allevals :: T = 20000, obj = allevals, grad = allevals, cons = allevals, jcon = allevals, jgrad = allevals, jac = allevals, jprod = allevals, jtprod = allevals, hess = allevals, hprod = allevals, jhprod = allevals, sum = 11 * allevals, kwargs...)`
Expand Down
6 changes: 3 additions & 3 deletions src/Stopping/StoppingMetamod.jl
Expand Up @@ -87,7 +87,7 @@ mutable struct StoppingMeta{TolType <: Number,

# fine grain control on ressources
max_f :: IntType # max function evaluations allowed TODO: used?
max_cntrs :: Dict{Symbol,Int64} #contains the detailed max number of evaluations
max_cntrs :: Dict{Symbol, Int} #contains the detailed max number of evaluations

# global control on ressources
max_eval :: IntType # max evaluations (f+g+H+Hv) allowed TODO: used?
Expand Down Expand Up @@ -130,7 +130,7 @@ function StoppingMeta(tol_check :: CheckType,
unbounded_threshold :: Number = 1.0e50, #typemax(Float64)
unbounded_x :: Number = 1.0e50,
max_f :: Int = typemax(Int),
max_cntrs :: Dict{Symbol,Int} = Dict{Symbol,Int64}(),
max_cntrs :: Dict{Symbol, Int} = Dict{Symbol, Int}(),
max_eval :: Int = 20000,
max_iter :: Int = 5000,
max_time :: Float64 = 300.0,
Expand Down Expand Up @@ -187,7 +187,7 @@ function StoppingMeta(;atol :: Number = 1.0e-6,
unbounded_threshold :: Number = 1.0e50, #typemax(Float64)
unbounded_x :: Number = 1.0e50,
max_f :: Int = typemax(Int),
max_cntrs :: Dict{Symbol,Int} = Dict{Symbol,Int64}(),
max_cntrs :: Dict{Symbol, Int} = Dict{Symbol, Int}(),
max_eval :: Int = 20000,
max_iter :: Int = 5000,
max_time :: Float64 = 300.0,
Expand Down

0 comments on commit adc3306

Please sign in to comment.