#include <Thyra_ScalarProdBaseDecl.hpp>
Inheritance diagram for Thyra::ScalarProdBase< Scalar >:

Destructor | |
| virtual | ~ScalarProdBase () |
| | |
Public pure virtual functions that must be overridden | |
| virtual void | scalarProds (const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, Scalar scalar_prods[]) const =0 |
| Return the scalar product of each column in two multi-vectors in the vector space. | |
| virtual void | apply (const EuclideanLinearOpBase< Scalar > &M, const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, MultiVectorBase< Scalar > *Y, const Scalar alpha, const Scalar beta) const =0 |
| Modify the application of a Euclidean linear operator by inserting the vector space's scalar product. | |
Public virtual functions with default implementations | |
| virtual bool | isEuclidean () const |
| Return if this is a Euclidean (identity) scalar product is the same as the dot product. | |
| virtual Scalar | scalarProd (const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const |
| Return the scalar product of two vectors in the vector space. | |
This interface is not considered a user-level interface. Instead, this interface is designed to be sub-classed off of and used with ScalarProdVectorSpaceBase objects to define their scalar products. Applications should create subclasses of this interface to define application-specific scalar products (i.e. such as PDE finite-element codes often do).
This interface requires subclasses to override a multi-vector version of the scalar product function scalarProds(). This version yields the most efficient implementation in a distributed memory environment by requiring only a single global reduction operation and a single communication.
Note that one of the preconditions on the vector and multi-vector arguments in scalarProds() is a little vague in stating that the vector or multi-vector objects must be "compatible" with the underlying implementation of *this. The reason that this precondition must be vague is that we can not expose a method to return a VectorSpaceBase object that could be checked for compatibility since ScalarProdBase is used to define a VectorSpaceBase object (through the VectorSpaceStdBase node subclass). Also, some definitions of ScalarProdBase (i.e. EuclideanScalarProd) will work for any vector space implementation since they only rely on RTOp operators. In other cases, however, an application-specific scalar product may a have dependency on the data-structure of vector and multi-vector objects in which case one can not just use this with any vector or multi-vector implementation.
This interface class also defines functions to modify the application of a Euclidean linear operator to insert the definition of the application specific scalar product.
Definition at line 74 of file Thyra_ScalarProdBaseDecl.hpp.
| virtual Thyra::ScalarProdBase< Scalar >::~ScalarProdBase | ( | ) | [inline, virtual] |
| virtual void Thyra::ScalarProdBase< Scalar >::scalarProds | ( | const MultiVectorBase< Scalar > & | X, | |
| const MultiVectorBase< Scalar > & | Y, | |||
| Scalar | scalar_prods[] | |||
| ) | const [pure virtual] |
Return the scalar product of each column in two multi-vectors in the vector space.
| X | [in] Multi-vector. | |
| Y | [in] Multi-vector. | |
| scalar_prod | [out] Array (length X.domain()->dim()) containing the scalar products scalar_prod[j] = this->scalarProd(*X.col(j),*Y.col(j)), for j = 0 ... X.domain()->dim()-1. |
X.domain()->isCompatible(*Y.domain()) (throw Exceptions::IncompatibleVectorSpaces) X.range()->isCompatible(*Y.range()) (throw Exceptions::IncompatibleVectorSpaces) X and Y are compatible with this implementation or an exception will be thrown. Postconditions:
scalar_prod[j] = this->scalarProd(*X.col(j),*Y.col(j)), for j = 0 ... X.domain()->dim()-1 Implemented in Thyra::EuclideanScalarProd< Scalar >, and Thyra::LinearOpScalarProd< Scalar >.
| virtual void Thyra::ScalarProdBase< Scalar >::apply | ( | const EuclideanLinearOpBase< Scalar > & | M, | |
| const EOpTransp | M_trans, | |||
| const MultiVectorBase< Scalar > & | X, | |||
| MultiVectorBase< Scalar > * | Y, | |||
| const Scalar | alpha, | |||
| const Scalar | beta | |||
| ) | const [pure virtual] |
Modify the application of a Euclidean linear operator by inserting the vector space's scalar product.
Note that one responsibility of an implementation of this function is to provide the block scalar product implementation of MultiVectorBase objects that derive from EuclideanLinearOpBase. For example, let M be a MultiVectorBase object and consider the operation
Y = adjoint(M)*X
where M_trans==CONJTRANS. This function may, or many not, call the EuclideanLinearOpBase::euclideanApplyTranspose() function in order to implement this block Scalar product.
Note that the special case of M==X should also be supported which provides the symmetric operation
Y = adjoint(X)*X
that can be performed in half the flops as the general case.
ToDo: Finish documentation!
Implemented in Thyra::EuclideanScalarProd< Scalar >, and Thyra::LinearOpScalarProd< Scalar >.
| bool Thyra::ScalarProdBase< Scalar >::isEuclidean | ( | ) | const [virtual] |
Return if this is a Euclidean (identity) scalar product is the same as the dot product.
The default implementation returns false (evenn though on average the truth is most likely true).
Reimplemented in Thyra::EuclideanScalarProd< Scalar >.
Definition at line 39 of file Thyra_ScalarProdBase.hpp.
| Scalar Thyra::ScalarProdBase< Scalar >::scalarProd | ( | const VectorBase< Scalar > & | x, | |
| const VectorBase< Scalar > & | y | |||
| ) | const [virtual] |
Return the scalar product of two vectors in the vector space.
Preconditions:
x and y are compatible with *this implementation or an exception will be thrown. x.space()->isCompatible(*y.space()) (throw Exceptions::IncompatibleVectorSpaces) Postconditions:
The default implementation calls on the multi-vector version scalarProds().
Definition at line 45 of file Thyra_ScalarProdBase.hpp.
1.4.7