Thyra::Converter< Scalar, TargetType > Class Template Reference
[Development of linear Abstract Numerical Algorithms (ANAs)]

Converter that defines the interface for objects that can be converted to vectors. More...

#include <Thyra_VectorDecl.hpp>

Inheritance diagram for Thyra::Converter< Scalar, TargetType >:

[legend]
List of all members.

Public Member Functions

virtual ~Converter ()
 
virtual TargetType convert () const =0
 Convert to the specified target type (e.g., Vector or ConstVector).
virtual void evalInto (Vector< Scalar > &acceptor) const =0
 Evaluate this object, writing the results into the acceptor vector.
virtual bool containsVector (const Thyra::VectorBase< Scalar > *vec) const =0
 Determine whether this object contains the given vector.
virtual void addInto (Vector< Scalar > &other, Thyra::LCSign sign) const =0
 Evaluate this object, adding the results into the argument vector. The sign argument indicates whether this operation is an addition or a subtraction.

Detailed Description

template<class Scalar, class TargetType>
class Thyra::Converter< Scalar, TargetType >

Converter that defines the interface for objects that can be converted to vectors.

Obviously, vectors can be converted to vectors, but so can linear combinations of vectors or operators times vectors.

This interface is key to efficient overloaded operators. Operators do not perform vector operations directly; rather, they construct Converter subtypes (such as LC2 or OpTimesLC) that represent the operation to be performed. The actual operations are carried out only upon either (a) assignment to a vector, or (b) the Converter is used in a context in which its vector value is required, for instance, when an operation such as a norm is to be performed.

Because overloaded operators must always create and return temporary objects, returning constant-size deferred-evaluation Converter subtypes rather than vectors results in constant-time overhead rather than the $O(N)$ overhead that would be incurred with vector return values.

Definition at line 79 of file Thyra_VectorDecl.hpp.


Constructor & Destructor Documentation

template<class Scalar, class TargetType>
virtual Thyra::Converter< Scalar, TargetType >::~Converter  )  [inline, virtual]
 

Definition at line 83 of file Thyra_VectorDecl.hpp.


Member Function Documentation

template<class Scalar, class TargetType>
virtual TargetType Thyra::Converter< Scalar, TargetType >::convert  )  const [pure virtual]
 

Convert to the specified target type (e.g., Vector or ConstVector).

Implemented in Thyra::ConstVector< Scalar >.

template<class Scalar, class TargetType>
virtual void Thyra::Converter< Scalar, TargetType >::evalInto Vector< Scalar > &  acceptor  )  const [pure virtual]
 

Evaluate this object, writing the results into the acceptor vector.

Implemented in Thyra::ConstVector< Scalar >.

template<class Scalar, class TargetType>
virtual bool Thyra::Converter< Scalar, TargetType >::containsVector const Thyra::VectorBase< Scalar > *  vec  )  const [pure virtual]
 

Determine whether this object contains the given vector.

Implemented in Thyra::ConstVector< Scalar >.

template<class Scalar, class TargetType>
virtual void Thyra::Converter< Scalar, TargetType >::addInto Vector< Scalar > &  other,
Thyra::LCSign  sign
const [pure virtual]
 

Evaluate this object, adding the results into the argument vector. The sign argument indicates whether this operation is an addition or a subtraction.

Implemented in Thyra::ConstVector< Scalar >.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:32:33 2008 for Thyra Operator/Vector Support by doxygen 1.3.9.1