RVL::LinCombOperator< Scalar > Class Template Reference

LinCombOperator is a concrete class implementing a linear combination of two or more Operator instances. More...

#include <op.hh>

Inheritance diagram for RVL::LinCombOperator< Scalar >:

RVL::Operator< Scalar > RVL::Writeable List of all members.

Public Member Functions

 LinCombOperator (LinCombOperator< Scalar > const &op)
 LinCombOperator (Scalar a1, Operator< Scalar > const &op1, Scalar a2, Operator< Scalar > const &op2)
 LinCombOperator (Scalar a1, Operator< Scalar > const &op1, Scalar a2, Operator< Scalar > const &op2, Scalar a3, Operator< Scalar > const &op3)
 LinCombOperator (Scalar a1, Operator< Scalar > const &op1, Scalar a2, Operator< Scalar > const &op2, Scalar a3, Operator< Scalar > const &op3, Scalar a4, Operator< Scalar > const &op4)
 LinCombOperator (Scalar a1, Operator< Scalar > const &op1, Scalar a2, Operator< Scalar > const &op2, Scalar a3, Operator< Scalar > const &op3, Scalar a4, Operator< Scalar > const &op4, Scalar a5, Operator< Scalar > const &op5)
 ~LinCombOperator ()
const Space< Scalar > & getDomain () const
 access to domain and range
const Space< Scalar > & getRange () const
ostream & write (ostream &str) const

Protected Member Functions

void apply (const Vector< Scalar > &x, Vector< Scalar > &val) const
void applyDeriv (const Vector< Scalar > &x, const Vector< Scalar > &dx, Vector< Scalar > &dy) const
void applyAdjDeriv (const Vector< Scalar > &x, const Vector< Scalar > &dy, Vector< Scalar > &dx) const
Operator< Scalar > * clone () const

Detailed Description

template<class Scalar>
class RVL::LinCombOperator< Scalar >

LinCombOperator is a concrete class implementing a linear combination of two or more Operator instances.

To construct the Operator $M = 2.0*L_1-3.7*L_2+9.0*L_3$, where L1, L2 and L3 are Operator instances,

LinCombOperator<float> M(2.0,L1,-3.7,L2,9.0,L3);

Constructors are provided for 2, 3, 4, and 5 summands; larger linear combinations may be built by recursively combining these.

Note that the LinCombOperator constructor is stack-based, that is, the linear combination must be instantiated within the scope of its summands. As with other fundamental RVL classes, this restriction exists to make dangling reference busts impossible. This restriction is necessary, absent enforced employment of smart pointers, since operator subtypes may store references to instances of other, stack-allocated data types.

The range and domain are determined by the operator in the first summand. All subsequent summands are checked for matching domain and range as they are submitted.

Definition at line 2605 of file op.hh.


Constructor & Destructor Documentation

template<class Scalar>
RVL::LinCombOperator< Scalar >::LinCombOperator ( LinCombOperator< Scalar > const &  op  ) 

Definition at line 2733 of file op.hh.

References RVL::LinCombOperator< Scalar >::opvec, and RVL::LinCombOperator< Scalar >::wtvec.

template<class Scalar>
RVL::LinCombOperator< Scalar >::LinCombOperator ( Scalar  a1,
Operator< Scalar > const &  op1,
Scalar  a2,
Operator< Scalar > const &  op2 
)

Definition at line 2745 of file op.hh.

template<class Scalar>
RVL::LinCombOperator< Scalar >::LinCombOperator ( Scalar  a1,
Operator< Scalar > const &  op1,
Scalar  a2,
Operator< Scalar > const &  op2,
Scalar  a3,
Operator< Scalar > const &  op3 
)

Definition at line 2758 of file op.hh.

template<class Scalar>
RVL::LinCombOperator< Scalar >::LinCombOperator ( Scalar  a1,
Operator< Scalar > const &  op1,
Scalar  a2,
Operator< Scalar > const &  op2,
Scalar  a3,
Operator< Scalar > const &  op3,
Scalar  a4,
Operator< Scalar > const &  op4 
)

Definition at line 2773 of file op.hh.

template<class Scalar>
RVL::LinCombOperator< Scalar >::LinCombOperator ( Scalar  a1,
Operator< Scalar > const &  op1,
Scalar  a2,
Operator< Scalar > const &  op2,
Scalar  a3,
Operator< Scalar > const &  op3,
Scalar  a4,
Operator< Scalar > const &  op4,
Scalar  a5,
Operator< Scalar > const &  op5 
)

Definition at line 2790 of file op.hh.

template<class Scalar>
RVL::LinCombOperator< Scalar >::~LinCombOperator (  ) 

Definition at line 2809 of file op.hh.


Member Function Documentation

template<class Scalar>
void RVL::LinCombOperator< Scalar >::apply ( const Vector< Scalar > &  x,
Vector< Scalar > &  val 
) const [protected, virtual]

Implements RVL::Operator< Scalar >.

Definition at line 2645 of file op.hh.

References RVL::Operator< Scalar >::export_apply(), RVL::LinCombOperator< Scalar >::getRange(), RVL::Vector< Scalar >::linComb(), and RVL::Vector< Scalar >::scale().

template<class Scalar>
void RVL::LinCombOperator< Scalar >::applyDeriv ( const Vector< Scalar > &  x,
const Vector< Scalar > &  dx,
Vector< Scalar > &  dy 
) const [protected, virtual]

Implements RVL::Operator< Scalar >.

Definition at line 2672 of file op.hh.

References RVL::Operator< Scalar >::export_applyDeriv(), RVL::LinCombOperator< Scalar >::getRange(), RVL::Vector< Scalar >::linComb(), and RVL::Vector< Scalar >::scale().

template<class Scalar>
void RVL::LinCombOperator< Scalar >::applyAdjDeriv ( const Vector< Scalar > &  x,
const Vector< Scalar > &  dy,
Vector< Scalar > &  dx 
) const [protected, virtual]

Implements RVL::Operator< Scalar >.

Definition at line 2699 of file op.hh.

References RVL::Operator< Scalar >::export_applyAdjDeriv(), RVL::LinCombOperator< Scalar >::getDomain(), RVL::Vector< Scalar >::linComb(), and RVL::Vector< Scalar >::scale().

template<class Scalar>
Operator<Scalar>* RVL::LinCombOperator< Scalar >::clone (  )  const [protected, virtual]

Implements RVL::Operator< Scalar >.

Definition at line 2726 of file op.hh.

template<class Scalar>
const Space<Scalar>& RVL::LinCombOperator< Scalar >::getDomain (  )  const [virtual]

access to domain and range

Implements RVL::Operator< Scalar >.

Definition at line 2814 of file op.hh.

Referenced by RVL::LinCombOperator< Scalar >::applyAdjDeriv().

template<class Scalar>
const Space<Scalar>& RVL::LinCombOperator< Scalar >::getRange (  )  const [virtual]

Implements RVL::Operator< Scalar >.

Definition at line 2830 of file op.hh.

Referenced by RVL::LinCombOperator< Scalar >::apply(), and RVL::LinCombOperator< Scalar >::applyDeriv().

template<class Scalar>
ostream& RVL::LinCombOperator< Scalar >::write ( ostream &  str  )  const [virtual]

Implements RVL::Writeable.

Definition at line 2846 of file op.hh.


The documentation for this class was generated from the following file:
Generated on 5 Jan 2017 for RVL by  doxygen 1.4.7