JuliaSmoothOptimizers / SolverTools.jl

Tools for developing nonlinear optimization solvers.
Other
26 stars 18 forks source link

```counter``` field as a ```NLPModels.Counters``` #101

Closed PEPERSO closed 5 years ago

PEPERSO commented 5 years ago

Hello, is it possible to consider the counter field as a NLPModels.Counters instead of a NLSModels.Counters ?

abelsiqueira commented 5 years ago

I think you mean NLPModels.NLSCounters, and I'm assuming you're talking about GenericExecutionStats. Please, correct me if I'm wrong.

Unfortunately, currently, it needs to be an NLSCounters, but the creation of a GenericExecutionStats is made from either an NLPModel or NLSModel, and the constructor should work accordingly.

Perhaps is easier to workaround depending on what you're trying to do.

PEPERSO commented 5 years ago

Yes, you're absolutely right, my mistake. It's just that I would like to use some counters.neval_obj or counters.neval_cons fields, but an NLSCounters has no such field, so I thought a NLPModels.Counters would be more generic

abelsiqueira commented 5 years ago

Are these counters part of an NLPModel? If so, you can use neval_obj(nlp). Although it could be useful to have neval_obj(counter) for different counter types.

If you always have an NLSCOunters, though, you can use counter.counters.neval_obj.

PEPERSO commented 5 years ago

Okay that's perfect with counter.counters.neval_obj, thank you