#include <functional.hh>
Inheritance diagram for RVL::StdFOFunctional< Scalar, DataType >:
Public Member Functions | |
StdFOFunctional (FunctionObjectScalarRedn< Scalar > &f_, FunctionObject &gradf_, FunctionObject &hessf_, const Space< Scalar > &dom_) | |
main constructor - takes references to functionals defining main protected methods, domain space. | |
StdFOFunctional (const StdFOFunctional< Scalar, DataType > &s) | |
~StdFOFunctional () | |
virtual const Space< Scalar > & | getDomain () const |
virtual ostream & | write (ostream &str) const |
Protected Member Functions | |
virtual void | apply (const Vector< Scalar > &x, Scalar &val) const |
![]() | |
virtual void | applyGradient (const Vector< Scalar > &x, Vector< Scalar > &g) const |
![]() | |
virtual void | applyHessian (const Vector< Scalar > &x, const Vector< Scalar > &dx, Vector< Scalar > &dy) const |
![]() | |
virtual Functional< Scalar > * | clone () const |
virtual copy constructor: make a complete new copy including internal workspace. | |
StdFOFunctional () | |
Protected Attributes | |
FunctionObjectScalarRedn< Scalar > & | f |
FunctionObject & | gradf |
FunctionObject & | hessf |
Space< Scalar > const & | dom |
Note that FunctionObject instances have persistent state and thus are not required to yield the same result when applied to the same data. Thus only FunctionObjects which do not change results on repeated evaluation at the same instance are usable in this construction.
Storage of intermediate results likely introduces inefficiencies. The use of this class is primarily for rapid prototyping or the implementation of functionals with no intermediate data between functional, gradient, and hessian evaluations. It is possible to get around this limitation by having these three FOs reference a common external object.
The functional evaluation is performed by a FunctionObjectScalarRedn which returns a Scalar value. The gradient computation is performed by a binary FunctionObject, which will be given the gradient (target) vector as the first input and the point x (data) vector as the second input. The hessian computation is performed by a ternary FunctionObject which will be given the target vector dy first, followed by the point x and direction dx .
Definition at line 1152 of file functional.hh.
RVL::StdFOFunctional< Scalar, DataType >::StdFOFunctional | ( | ) | [protected] |
RVL::StdFOFunctional< Scalar, DataType >::StdFOFunctional | ( | FunctionObjectScalarRedn< Scalar > & | f_, | |
FunctionObject & | gradf_, | |||
FunctionObject & | hessf_, | |||
const Space< Scalar > & | dom_ | |||
) |
main constructor - takes references to functionals defining main protected methods, domain space.
Definition at line 1203 of file functional.hh.
RVL::StdFOFunctional< Scalar, DataType >::StdFOFunctional | ( | const StdFOFunctional< Scalar, DataType > & | s | ) |
Definition at line 1209 of file functional.hh.
RVL::StdFOFunctional< Scalar, DataType >::~StdFOFunctional | ( | ) |
Definition at line 1212 of file functional.hh.
virtual void RVL::StdFOFunctional< Scalar, DataType >::apply | ( | const Vector< Scalar > & | x, | |
Scalar & | val | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 1162 of file functional.hh.
References RVL::Vector< Scalar >::eval(), RVL::StdFOFunctional< Scalar, DataType >::f, and RVL::ScalarRedn< Scalar >::getValue().
virtual void RVL::StdFOFunctional< Scalar, DataType >::applyGradient | ( | const Vector< Scalar > & | x, | |
Vector< Scalar > & | g | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 1177 of file functional.hh.
References RVL::Vector< Scalar >::eval(), and RVL::StdFOFunctional< Scalar, DataType >::gradf.
virtual void RVL::StdFOFunctional< Scalar, DataType >::applyHessian | ( | const Vector< Scalar > & | x, | |
const Vector< Scalar > & | dx, | |||
Vector< Scalar > & | dy | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 1183 of file functional.hh.
References RVL::Vector< Scalar >::eval(), and RVL::StdFOFunctional< Scalar, DataType >::hessf.
virtual Functional<Scalar>* RVL::StdFOFunctional< Scalar, DataType >::clone | ( | ) | const [protected, virtual] |
virtual copy constructor: make a complete new copy including internal workspace.
Virtual to permit override in child class.
Implements RVL::Functional< Scalar >.
Definition at line 1194 of file functional.hh.
virtual const Space<Scalar>& RVL::StdFOFunctional< Scalar, DataType >::getDomain | ( | ) | const [virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 1215 of file functional.hh.
References RVL::StdFOFunctional< Scalar, DataType >::dom.
virtual ostream& RVL::StdFOFunctional< Scalar, DataType >::write | ( | ostream & | str | ) | const [virtual] |
Implements RVL::Writeable.
Definition at line 1217 of file functional.hh.
References RVL::StdFOFunctional< Scalar, DataType >::f, RVL::StdFOFunctional< Scalar, DataType >::gradf, RVL::StdFOFunctional< Scalar, DataType >::hessf, RVL::FunctionObject::write(), and RVL::FunctionObjectConstEval::write().
FunctionObjectScalarRedn<Scalar>& RVL::StdFOFunctional< Scalar, DataType >::f [protected] |
Definition at line 1154 of file functional.hh.
Referenced by RVL::StdFOFunctional< Scalar, DataType >::apply(), and RVL::StdFOFunctional< Scalar, DataType >::write().
FunctionObject& RVL::StdFOFunctional< Scalar, DataType >::gradf [protected] |
Definition at line 1155 of file functional.hh.
Referenced by RVL::StdFOFunctional< Scalar, DataType >::applyGradient(), and RVL::StdFOFunctional< Scalar, DataType >::write().
FunctionObject& RVL::StdFOFunctional< Scalar, DataType >::hessf [protected] |
Definition at line 1156 of file functional.hh.
Referenced by RVL::StdFOFunctional< Scalar, DataType >::applyHessian(), and RVL::StdFOFunctional< Scalar, DataType >::write().
Space<Scalar> const& RVL::StdFOFunctional< Scalar, DataType >::dom [protected] |
Definition at line 1157 of file functional.hh.
Referenced by RVL::StdFOFunctional< Scalar, DataType >::getDomain().