.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEOpt



.. meta::
   :keywords: OECheckpoint0, Checkpoint0


.. _OEOpt_OECheckpoint0:

.. oe:class:: OECheckpoint0

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class OECheckpoint0

   The :ref:`OECheckpoint0 <OEOpt_OECheckpoint0>` class is an abstract class which provides a "callback"
   facility to monitor the progress of an optimization. In addition, the checkpoint class can 
   also be used to control the termination of an optimization. This class is specifically for use 
   with optimizers which do not use gradients.

   The :ref:`OECheckpoint0 <OEOpt_OECheckpoint0>` class defines the following public methods:
    * :oe:meth:`operator()<OEOpt::OECheckpoint0::operator()>` 
   
   The following classes derive from this class:
    * :ref:`OECheckpoint1 <OEOpt_OECheckpoint1>`

   .. oe:method:: operator()

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool operator()(unsigned int iteration, unsigned int nvar, double fval, const double* var = (double*)0, unsigned int state = 0) = 0

      .. oe:language:: python

         .. oe:api:: python

            __call__(iteration: int, nvar: int, fval: float,
                     var: OEDoubleArray = (OEDoubleArray), state: int = 0) -> bool

      This operator method is called by an optimizer at least once per iteration during 
      an optimization. The variables passed to the method from the optimizer reflect the 
      current state of an optimization.

      *iteration*
         The iteration number.

      *nvar*
         The number of variables.

      *fval* 
         The most recent function evaluation during the current iteration.

      *var* 
         Array containing current set of optimized variables.  If available, the array has a length of ``nvar``.

      *state*
         The current state of optimization.

