class OEMolFunc1 : public OEOpt::OEFunc1,
public OEMolPotential::OEMolSetup
The OEMolFunc1 base class defines the interface for stateful
functions which operate on molecules and conformers.
OEMolFunc1 extends the OEFunc1 interface by adding the
Setup method defined in OEMolSetup. Classes derived from
OEFunc1 are intended for use with optimizers which utilize
gradients.
virtual double operator()(const double *coord) virtual double operator()(const double *coord, double *grad)
The operator() pure virtual methods define the interface for
function evaluation given a set of molecule coordinates. In addition,
the second method computes a set of gradients for the molecule
coordinates. There is a one to one correspondence between the
elements of the variable and gradient arrays (i.e. the first
gradient element corresponds to the first variable element). Methods
that override the gradient calculation operator must not initialize the
gradient array, but rather assume the array has already been
initialized. By convention, classes derived from
OEOpt::OEOptimizer1 must initialize gradient arrays before
calling a function evaluation.
virtual void ClearPredicates()
The ClearPredicates method deletes all stored predicates set
previously using one of the overloaded Set methods. Predicates
control function initialization behavior of overridden
OEMolFunc1::Setup methods.
virtual OESystem::OEIterBase<OEOpt::OEFComponent>*
GetFComponents(const double *coord)
This pure virtual method defines the interface for retrieving function component name and value information given a set of molecular coordinates. Overrides of this method take a pointer to a set of molecular coordinates, and returns an iterator over the names and component energies (Section 3.4) calculated for the coordinates.
virtual OESystem::OEIterBase<OEInteraction>
*GetInteractions(const OEChem::OEMolBase &mol,
const double *coord,
unsigned functype=0) const
The GetInteractions method defines the interface for retrieving
interaction level information computed by the OEMolFunc1
instance, given a molecule and a set of coordinates. See the section
describing the OEInteraction class
(Section 3.11) for details regarding interaction
interrogation and reporting. If the OEMolFunc1 is a
composition of multiple components, the last argument may be used to
request the interactions of only a single component by passing a value
from the OEFuncType namespace. The GetInteractions
method is beta in the CASE v1.0 release.
virtual unsigned int NumVar() const
The NumVar pure virtual method defines the interface for
returning the number of variables for which an OEMolFunc1
derived instance has been initialized using the
OEMolFunc1::Setup method.
virtual bool Set(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred,
unsigned int flag)
virtual bool Set(const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &pred,
unsigned int flag)
virtual bool Set(const OESystem::OEBinaryPredicate<OEChem::OEAtomBase,
OEChem::OEAtomBase> &pred,
unsigned int flag)
virtual bool Set(const OESystem::OEBinaryPredicate<OEChem::OEBondBase,
OEChem::OEBondBase> &pred,
unsigned int flag)
These methods assign interaction-control predicates to the
OEMolFunc1 derived instance. The first argument is the
predicate type to be passed to the interaction component. The second
argument is a value or a set of binary OR'ed values taken from the
OEFuncType namespace which specifies the intended target for
the predicate assignment. Classes derived from OEMolFunc1 do
not need to define all OEMolFunc1::Set methods. Default
implementations are provided for cases where definition of the
method(s) are not appropriate.
virtual bool Setup(const OEChem::OEMolBase &mol)
The Setup pure virtual method defines the interface for
initializing a OEMolFunc1 derived instance. Functions
typically require perception of the passed molecule for efficient
function evaluation.
virtual bool SetupConf(const double *coord)
The SetupConf pure virtual method defines the interface for
initializing a OEMolFunc0 derived instance with coordinates of
a particular conformer. Functions and adaptors that require initial
coordinates of a conformer for evaluation, but do not need a call to
Setup for every conformer may instead acquire a new set of
conformer coordinates by the SetupConf method. Constraint
functions, for example, may only require a single call to Setup
with a connection table, but subsequent conformer evaluations may be
performed after calling SetupConf.