#include <Thyra_VectorDecl.hpp>
Inheritance diagram for Thyra::Converter< Scalar, TargetType >:
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 std::vector. | |
| virtual bool | containsVector (const Thyra::VectorBase< Scalar > *vec) const =0 |
| Determine whether this object contains the given std::vector. | |
| virtual void | addInto (Vector< Scalar > &other, Thyra::LCSign sign) const =0 |
| Evaluate this object, adding the results into the argument std::vector. The sign argument indicates whether this operation is an addition or a subtraction. | |
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 std::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 std::vector, or (b) the Converter is used in a context in which its std::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
overhead that would be incurred with std::vector return values.
Definition at line 79 of file Thyra_VectorDecl.hpp.
| virtual Thyra::Converter< Scalar, TargetType >::~Converter | ( | ) | [inline, virtual] |
| virtual TargetType Thyra::Converter< Scalar, TargetType >::convert | ( | ) | const [pure virtual] |
Convert to the specified target type (e.g., Vector or ConstVector).
Implemented in Thyra::ConvertibleToVector< Scalar >, and Thyra::ConstVector< Scalar >.
| virtual void Thyra::Converter< Scalar, TargetType >::evalInto | ( | Vector< Scalar > & | acceptor | ) | const [pure virtual] |
Evaluate this object, writing the results into the acceptor std::vector.
Implemented in Thyra::OpTimesLC< Scalar, Node >, Thyra::LC2< Scalar, Node1, Node2 >, and Thyra::ConstVector< Scalar >.
| virtual bool Thyra::Converter< Scalar, TargetType >::containsVector | ( | const Thyra::VectorBase< Scalar > * | vec | ) | const [pure virtual] |
Determine whether this object contains the given std::vector.
Implemented in Thyra::OpTimesLC< Scalar, Node >, Thyra::LC2< Scalar, Node1, Node2 >, and Thyra::ConstVector< Scalar >.
| 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 std::vector. The sign argument indicates whether this operation is an addition or a subtraction.
Implemented in Thyra::OpTimesLC< Scalar, Node >, Thyra::LC2< Scalar, Node1, Node2 >, and Thyra::ConstVector< Scalar >.
1.4.7