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

.. oe:namespace:: OEMolPotential



.. meta::
   :keywords: OENumericMolFunc2, NumericMolFunc2


.. _OEMolPotential_OENumericMolFunc2:

.. oe:class:: OENumericMolFunc2

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class OENumericMolFunc2 : public OEMolFunc2

   The :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>` class converts a :ref:`OEMolFunc1 <OEMolPotential_OEMolFunc1>`
   into a :ref:`OEMolFunc2 <OEMolPotential_OEMolFunc2>` by providing numeric hessians.

   .. _figure_OENumericMolFunc2_Hierarchy:

   .. figure:: ../images/OENumericMolFunc2.*
      :align:  center

   The following methods are publicly inherited from :ref:`OEFunc0 <OEOpt_OEFunc0>`:
    * :oe:meth:`operator()<OEOpt::OEFunc0::operator()>`         
    * :oe:meth:`GetFComponents<OEOpt::OEFunc0::GetFComponents>` 
    * :oe:meth:`NumVar<OEOpt::OEFunc0::NumVar>`

   The following methods are publicly inherited from :ref:`OEFunc1 <OEOpt_OEFunc1>`:
    * :oe:meth:`operator()<OEOpt::OEFunc1::operator()>`

   The following methods are publicly inherited from :ref:`OEFunc2 <OEOpt_OEFunc2>`:
    * :oe:meth:`operator()<OEOpt::OEFunc2::operator()>`
   
   The following methods are publicly inherited from :ref:`OEMolFunc <OEMolPotential_OEMolFunc>`:
    * :oe:meth:`Clear<OEMolPotential::OEMolFunc::Clear>`   
    * :oe:meth:`ClearPredicates<OEMolPotential::OEMolFunc::ClearPredicates>`
    * :oe:meth:`GetInteractions<OEMolPotential::OEMolFunc::GetInteractions>`
    * :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`

   The :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>` class defines the following public methods:
    * :oe:meth:`Set<OEMolPotential::OENumericMolFunc2::Set>`

   .. oe:method:: Constructors

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

         .. oe:api::

            OENumericMolFunc2(OEMolFunc1 &, bool own = false)

      .. oe:language:: python

         .. oe:api:: python

            OENumericMolFunc2(argFunc1: OEMolFunc1, argOwn: bool = False) -> OENumericMolFunc2

      Default and copy constructors.

      The molecule function used for function evaluation and to be converted must be provided as the first argument to
      the constructor. The second argument specifies the scaling factor. The third argument specifies whether the 
      :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>` object takes ownership of the memory of the molecule
      function instance. By default that does not happen, so the :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>`
      destructor does not delete the molecule function instance. If ownership of the molecule function 
      is transferred to the :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>` instance, the molecule function's
      delete operator will be called in the :ref:`OENumericMolFunc2 <OEMolPotential_OENumericMolFunc2>` destructor.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OENumericMolFunc2 & operator=(const OENumericMolFunc2 &)

      Assignment operator.

   

   .. oe:method:: Set

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

         .. oe:api::

            bool Set(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& pred,
                     unsigned int functype)
            bool Set(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred,
                     unsigned int functype)
            bool Set(const OESystem::OEBinaryPredicate<OEChem::OEAtomBase, OEChem::OEAtomBase>& pred,
                     unsigned int functype)
            bool Set(const OESystem::OEBinaryPredicate<OEChem::OEBondBase, OEChem::OEBondBase>& pred,
                     unsigned int functype)

      .. oe:language:: python

         .. oe:api:: python

            Set(pred: OEUnaryBondPred, functype: int) -> bool
            Set(pred: OEUnaryAtomPred, functype: int) -> bool
            Set(pred: OEBinaryAtomPred, functype: int) -> bool
            Set(pred: OEBinaryBondPred, functype: int) -> bool

      Predicates are passed directly to the molecule function that is to be scaled.

