#include <functional.hh>
Inheritance diagram for RVL::LinCombFunctional< Scalar >:
Public Member Functions | |
LinCombFunctional () | |
LinCombFunctional (LinCombFunctional< Scalar > const &fn) | |
LinCombFunctional (Scalar a1, const Functional< Scalar > &fn1, Scalar a2, const Functional< Scalar > &fn2) | |
~LinCombFunctional () | |
const Space< Scalar > & | getDomain () const |
access to domain and range | |
ostream & | write (ostream &str) const |
Protected Member Functions | |
void | apply (const Vector< Scalar > &x, Scalar &val) const |
void | applyGradient (const Vector< Scalar > &x, Vector< Scalar > &g) const |
void | applyHessian (const Vector< Scalar > &x, const Vector< Scalar > &dx, Vector< Scalar > &dy) const |
Functional< Scalar > * | clone () const |
To construct the Functional M = 2L1-3.7L2+9.0L3, where L1, L2 and L3 are Functional instances,
LinCombFunctional<float> M; M.setNext(2.0,L1); M.setNext(-3.7,L2); M.setNext(9.0,L3);
Because linear combinations of two Functionals occur frequently, and for backwards compatibility, a special constructor is provided for this case:
LinCombFunctional<float> M(2.0,L1,-3.7,L2);
constructs M = 2L1-3.7L2.
Post-construction initialization permits linear combinations of arbitrary length, but requires that the user signal when the initialization is complete, so that well-defined behaviour results. As in OpComp, this class uses the convention that the first non-initialization method call flags the completion of the linear combination. No subsequent modifications are permitted.
The domain is determined by the Functional in the first summand. All subsequent summands are checked for matching domain as they are submitted.
Definition at line 922 of file functional.hh.
RVL::LinCombFunctional< Scalar >::LinCombFunctional | ( | ) |
Definition at line 1049 of file functional.hh.
RVL::LinCombFunctional< Scalar >::LinCombFunctional | ( | LinCombFunctional< Scalar > const & | fn | ) |
Definition at line 1050 of file functional.hh.
References RVL::LinCombFunctional< Scalar >::fnvec, and RVL::LinCombFunctional< Scalar >::wtvec.
RVL::LinCombFunctional< Scalar >::LinCombFunctional | ( | Scalar | a1, | |
const Functional< Scalar > & | fn1, | |||
Scalar | a2, | |||
const Functional< Scalar > & | fn2 | |||
) |
Definition at line 1063 of file functional.hh.
References RVL::Functional< Scalar >::clone(), RVL::Functional< Scalar >::getDomain(), and RVL::Writeable::write().
RVL::LinCombFunctional< Scalar >::~LinCombFunctional | ( | ) |
Definition at line 1088 of file functional.hh.
void RVL::LinCombFunctional< Scalar >::apply | ( | const Vector< Scalar > & | x, | |
Scalar & | val | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 962 of file functional.hh.
References RVL::Functional< Scalar >::export_apply().
void RVL::LinCombFunctional< Scalar >::applyGradient | ( | const Vector< Scalar > & | x, | |
Vector< Scalar > & | g | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 989 of file functional.hh.
References RVL::Functional< Scalar >::export_applyGradient(), RVL::LinCombFunctional< Scalar >::getDomain(), RVL::Vector< Scalar >::linComb(), and RVL::Vector< Scalar >::scale().
void RVL::LinCombFunctional< Scalar >::applyHessian | ( | const Vector< Scalar > & | x, | |
const Vector< Scalar > & | dx, | |||
Vector< Scalar > & | dy | |||
) | const [protected, virtual] |
Implements RVL::Functional< Scalar >.
Definition at line 1015 of file functional.hh.
References RVL::Functional< Scalar >::export_applyHessian(), RVL::LinCombFunctional< Scalar >::getDomain(), RVL::Vector< Scalar >::linComb(), and RVL::Vector< Scalar >::scale().
Functional<Scalar>* RVL::LinCombFunctional< Scalar >::clone | ( | ) | const [protected, virtual] |
const Space<Scalar>& RVL::LinCombFunctional< Scalar >::getDomain | ( | ) | const [virtual] |
access to domain and range
Implements RVL::Functional< Scalar >.
Definition at line 1093 of file functional.hh.
Referenced by RVL::LinCombFunctional< Scalar >::applyGradient(), and RVL::LinCombFunctional< Scalar >::applyHessian().
ostream& RVL::LinCombFunctional< Scalar >::write | ( | ostream & | str | ) | const [virtual] |