#include <functional.hh>
Inheritance diagram for RVL::FunctionalEvaluation< Scalar >:
Public Member Functions | |
FunctionalEvaluation (const Functional< Scalar > &_f, const Vector< Scalar > &x) | |
main constructor - combines const references to Functional, Vector. | |
FunctionalEvaluation (const FunctionalEvaluation< Scalar > &ev) | |
virtual | ~FunctionalEvaluation () |
const Space< Scalar > & | getDomain () const |
access to domain | |
Scalar | getMaxStep (const Vector< Scalar > &dx) const |
Returns the maximum scalar alpha for which x+alpha*dx is still in the domain of the functional. | |
Vector< Scalar > & | getPoint () |
const reference to evaluation point | |
Vector< Scalar > const & | getPoint () const |
Scalar | getValue () const |
extract value of functional at evaluation point. | |
Vector< Scalar > const & | getGradient () const |
returns a reference to the gradient of the functional at the current point. | |
Scalar | getGradientNorm () const |
Returns the norm of the gradient of the functional at the current point. | |
LinearOp< Scalar > const & | getHessian () const |
Returns a LinearOp representing the Hessian of the functional. | |
Functional< Scalar > const & | getFunctional () const |
provided to enable extraction of subclass attributes via a cast, from the current internal copy of the underlying Functional. | |
ostream & | write (ostream &str) const |
Protected Member Functions | |
void | applyHessian (const Vector< Scalar > &yin, Vector< Scalar > &yout) const |
const ProductSpace< Scalar > & | getProductDomain () const |
The next two functions throw exceptions if the referenced functional is not a FcnlProdDom. | |
Vector< Scalar > const & | getPartialGradient (int i) const |
void | applyPartialHessian (int i, int j, const Vector< Scalar > &dxi, Vector< Scalar > &dxj) const |
applyPartialHessian() computes the image of the (i,j) block of the Hessian on derivative on dxi, giving dxj. | |
void * | operator new (size_t size) |
operator new - not available to general public, but available to children and friends | |
Protected Attributes | |
Components< Scalar > | cg |
HessianEvaluation< Scalar > | hess |
Friends | |
class | HessianEvaluation< Scalar > |
class | PartialHessianEvaluation< Scalar > |
class | FcnlOpComp< Scalar > |
The Functional is re-cloned automatically when the evaluation point Vector changes internal state.
Definition at line 424 of file functional.hh.
RVL::FunctionalEvaluation< Scalar >::FunctionalEvaluation | ( | const Functional< Scalar > & | _f, | |
const Vector< Scalar > & | x | |||
) |
main constructor - combines const references to Functional, Vector.
The Functional is cloned, and the clone is used as working copy. The const reference is copied (along with that to the evaluation point Vector) and used whenever fresh Functional clones are needed.
Definition at line 574 of file functional.hh.
References RVL::Vector< Scalar >::getSpace().
RVL::FunctionalEvaluation< Scalar >::FunctionalEvaluation | ( | const FunctionalEvaluation< Scalar > & | ev | ) |
Definition at line 606 of file functional.hh.
virtual RVL::FunctionalEvaluation< Scalar >::~FunctionalEvaluation | ( | ) | [virtual] |
Definition at line 613 of file functional.hh.
void RVL::FunctionalEvaluation< Scalar >::applyHessian | ( | const Vector< Scalar > & | yin, | |
Vector< Scalar > & | yout | |||
) | const [protected] |
Definition at line 469 of file functional.hh.
const ProductSpace<Scalar>& RVL::FunctionalEvaluation< Scalar >::getProductDomain | ( | ) | const [protected] |
The next two functions throw exceptions if the referenced functional is not a FcnlProdDom.
They are accessed only by PartialHessianEval, via FcnlProdDomEval, which provides compile time type-safety in addition to the run-time type checking built into these methods.
Definition at line 488 of file functional.hh.
References RVL::FunctionalProductDomain< Scalar >::getProductDomain().
Vector<Scalar> const& RVL::FunctionalEvaluation< Scalar >::getPartialGradient | ( | int | i | ) | const [protected] |
Reimplemented in RVL::FunctionalProductDomainEvaluation< Scalar >.
Definition at line 508 of file functional.hh.
References RVL::FunctionalEvaluation< Scalar >::cg.
void RVL::FunctionalEvaluation< Scalar >::applyPartialHessian | ( | int | i, | |
int | j, | |||
const Vector< Scalar > & | dxi, | |||
Vector< Scalar > & | dxj | |||
) | const [protected] |
applyPartialHessian() computes the image of the (i,j) block of the Hessian on derivative on dxi, giving dxj.
Definition at line 528 of file functional.hh.
References RVL::FunctionalProductDomain< Scalar >::applyPartialHessian().
void* RVL::FunctionalEvaluation< Scalar >::operator new | ( | size_t | size | ) | [protected] |
operator new - not available to general public, but available to children and friends
Version 1.0: user control
Definition at line 560 of file functional.hh.
const Space<Scalar>& RVL::FunctionalEvaluation< Scalar >::getDomain | ( | ) | const |
Scalar RVL::FunctionalEvaluation< Scalar >::getMaxStep | ( | const Vector< Scalar > & | dx | ) | const |
Returns the maximum scalar alpha for which x+alpha*dx is still in the domain of the functional.
Definition at line 629 of file functional.hh.
References RVL::FunctionalEvaluation< Scalar >::getPoint().
Vector<Scalar>& RVL::FunctionalEvaluation< Scalar >::getPoint | ( | ) |
const reference to evaluation point
Definition at line 635 of file functional.hh.
Referenced by RVL::FunctionalEvaluation< Scalar >::getMaxStep().
Vector<Scalar> const& RVL::FunctionalEvaluation< Scalar >::getPoint | ( | ) | const |
Definition at line 636 of file functional.hh.
Scalar RVL::FunctionalEvaluation< Scalar >::getValue | ( | ) | const |
extract value of functional at evaluation point.
Checks to see if latter has been updated; if so, updates internal copy of value.
Definition at line 641 of file functional.hh.
Referenced by RVL::GradientTest().
Vector<Scalar> const& RVL::FunctionalEvaluation< Scalar >::getGradient | ( | ) | const |
returns a reference to the gradient of the functional at the current point.
WARNING: It is not safe to save a reference to the gradient. This method should be called to ensure proper recalculation of the gradient when the point changes.
Definition at line 663 of file functional.hh.
Referenced by RVL::FunctionalEvaluation< Scalar >::getGradientNorm(), and RVL::GradientTest().
Scalar RVL::FunctionalEvaluation< Scalar >::getGradientNorm | ( | ) | const |
Returns the norm of the gradient of the functional at the current point.
WARNING: It is not safe to save a reference to the gradient. This method (or the getGradient() method) should be called to ensure proper recalculation of the gradient when the point changes.
Definition at line 686 of file functional.hh.
References RVL::FunctionalEvaluation< Scalar >::getGradient().
LinearOp<Scalar> const& RVL::FunctionalEvaluation< Scalar >::getHessian | ( | ) | const |
Returns a LinearOp representing the Hessian of the functional.
This LinearOp is a lightweight object that refers back to the evaluation, and get destroyed in the evaluation destructor. It is safe to store a reference to the Hessian for the lifetime of the evaluation.
Definition at line 709 of file functional.hh.
References RVL::FunctionalEvaluation< Scalar >::hess.
Functional<Scalar> const& RVL::FunctionalEvaluation< Scalar >::getFunctional | ( | ) | const |
provided to enable extraction of subclass attributes via a cast, from the current internal copy of the underlying Functional.
Definition at line 714 of file functional.hh.
ostream& RVL::FunctionalEvaluation< Scalar >::write | ( | ostream & | str | ) | const [virtual] |
Implements RVL::Writeable.
Reimplemented in RVL::FunctionalProductDomainEvaluation< Scalar >.
Definition at line 716 of file functional.hh.
friend class HessianEvaluation< Scalar > [friend] |
Definition at line 426 of file functional.hh.
friend class PartialHessianEvaluation< Scalar > [friend] |
Definition at line 427 of file functional.hh.
friend class FcnlOpComp< Scalar > [friend] |
Definition at line 428 of file functional.hh.
Components<Scalar> RVL::FunctionalEvaluation< Scalar >::cg [protected] |
Definition at line 465 of file functional.hh.
Referenced by RVL::FunctionalEvaluation< Scalar >::getPartialGradient().
HessianEvaluation<Scalar> RVL::FunctionalEvaluation< Scalar >::hess [protected] |
Definition at line 466 of file functional.hh.
Referenced by RVL::FunctionalEvaluation< Scalar >::getHessian().