Public Member Functions | |
| ObjectiveBase (int verb=0) | |
| virtual | ~ObjectiveBase () |
| virtual void | evalGrad (const Vector< double > &x, double &f, Vector< double > &grad) const =0 |
| virtual void | eval (const Vector< double > &x, double &f) const =0 |
| virtual Vector< double > | getInit () const =0 |
| virtual double | getInvHScale () const |
| virtual void | iterationCallback (const Vector< double > &x, int iter) const |
| virtual void | finalCallback (const Vector< double > &x) const |
| void | setContextString (const string &str) const |
| const string & | contextString () const |
| virtual int | numFuncEvals () const |
| virtual string | description () const |
| bool | fdCheck (const Vector< double > &x, double tol, int verbosity=0) const |
Protected Member Functions | |
| virtual double | fdStep () const |
Private Attributes | |
| string | contextString_ |
Base class for differentiable objective functions.
Definition at line 64 of file PlayaObjectiveBase.hpp.
| Playa::ObjectiveBase::ObjectiveBase | ( | int | verb = 0 | ) | [inline] |
Definition at line 69 of file PlayaObjectiveBase.hpp.
| virtual Playa::ObjectiveBase::~ObjectiveBase | ( | ) | [inline, virtual] |
virtual dtor
Definition at line 72 of file PlayaObjectiveBase.hpp.
| const string& Playa::ObjectiveBase::contextString | ( | ) | const [inline] |
Set a string describing the context in which the function is being called. This is intended to aid in reading diagnostic output.
Definition at line 106 of file PlayaObjectiveBase.hpp.
References contextString_.
| virtual string Playa::ObjectiveBase::description | ( | ) | const [inline, virtual] |
Definition at line 116 of file PlayaObjectiveBase.hpp.
| virtual void Playa::ObjectiveBase::eval | ( | const Vector< double > & | x, |
| double & | f | ||
| ) | const [pure virtual] |
evaluate objective function without gradient.
Implemented in Sundance::PDEConstrainedObjBase.
Referenced by fdCheck().
| virtual void Playa::ObjectiveBase::evalGrad | ( | const Vector< double > & | x, |
| double & | f, | ||
| Vector< double > & | grad | ||
| ) | const [pure virtual] |
evaluate objective function and gradient
Implemented in Sundance::PDEConstrainedObjBase.
Referenced by fdCheck().
| bool Playa::ObjectiveBase::fdCheck | ( | const Vector< double > & | x, |
| double | tol, | ||
| int | verbosity = 0 |
||
| ) | const |
Debugging utility to check the gradient by comparing to a finite difference gradient calculation. This is will be expensive.
eval at xPlus
Definition at line 57 of file PlayaObjectiveBase.cpp.
References Playa::VectorSpace< Scalar >::baseGlobalNaturalIndex(), Playa::Vector< Scalar >::copy(), Playa::VectorSpace< Scalar >::dim(), eval(), evalGrad(), fdStep(), Playa::VectorSpace< Scalar >::numLocalElements(), PLAYA_MSG1, PLAYA_MSG2, PLAYA_MSG3, and Playa::Vector< Scalar >::space().
| virtual double Playa::ObjectiveBase::fdStep | ( | ) | const [inline, protected, virtual] |
Definition at line 125 of file PlayaObjectiveBase.hpp.
Referenced by fdCheck().
| virtual void Playa::ObjectiveBase::finalCallback | ( | const Vector< double > & | x | ) | const [inline, virtual] |
User-overrideable hook for any callbacks to be done at the end of an optimization loop. Default is a no-op.
Definition at line 94 of file PlayaObjectiveBase.hpp.
| virtual Vector<double> Playa::ObjectiveBase::getInit | ( | ) | const [pure virtual] |
return an initial guess for the design vector
Implemented in Sundance::PDEConstrainedObjBase.
| virtual double Playa::ObjectiveBase::getInvHScale | ( | ) | const [inline, virtual] |
return an initial approximation to the scale for the inverse of the Hessian
Reimplemented in Sundance::PDEConstrainedObjBase.
Definition at line 86 of file PlayaObjectiveBase.hpp.
| virtual void Playa::ObjectiveBase::iterationCallback | ( | const Vector< double > & | x, |
| int | iter | ||
| ) | const [inline, virtual] |
User-overrideable hook for any callbacks to be done at the end of each iteration. Default is a no-op.
Reimplemented in Sundance::PDEConstrainedObjBase.
Definition at line 90 of file PlayaObjectiveBase.hpp.
| virtual int Playa::ObjectiveBase::numFuncEvals | ( | ) | const [inline, virtual] |
Return the number of evaluations
Reimplemented in Sundance::PDEConstrainedObjBase.
Definition at line 111 of file PlayaObjectiveBase.hpp.
| void Playa::ObjectiveBase::setContextString | ( | const string & | str | ) | const [inline] |
Set a string describing the context in which the function is being called. This is intended to aid in reading diagnostic output.
Definition at line 100 of file PlayaObjectiveBase.hpp.
References contextString_.
string Playa::ObjectiveBase::contextString_ [mutable, private] |
Definition at line 129 of file PlayaObjectiveBase.hpp.
Referenced by contextString(), and setContextString().