Skip to contents

Counters() holds the numbers of evaluations of an NLPModels model (neval_obj, neval_grad, neval_cons, neval_jac, neval_jprod, neval_jtprod, neval_hess, neval_hprod and their linear, nonlinear and per constraint variants), all zero. NLSCounters() adds the evaluations of a least squares residual (neval_residual, neval_jac_residual, ...) and forwards the fields of its counters. Both are environments updated in place by the evaluation functions of NLPModels; read a field with c$neval_obj.

Usage

Counters()

NLSCounters()

Value

A Counters or NLSCounters environment.

Examples

cnt <- Counters()
cnt$neval_obj
#> [1] 0
NLPModels$sum_counters(cnt)
#> [1] 0
nc <- NLSCounters()
nc$neval_residual; nc$neval_obj
#> [1] 0
#> [1] 0