VectorSpaceBase that allows the definition of an application-specific scalar product to be swapped in and out.
More...
#include <Thyra_ScalarProdVectorSpaceBaseDecl.hpp>
Inheritance diagram for Thyra::ScalarProdVectorSpaceBase< Scalar >:
Constructors / initializers | |
| ScalarProdVectorSpaceBase () | |
| Construct to use dot product as the default. | |
| ScalarProdVectorSpaceBase (const Teuchos::RefCountPtr< const ScalarProdBase< Scalar > > &scalarProd) | |
| Construct with a different scalar product. | |
| virtual void | setScalarProd (const Teuchos::RefCountPtr< const ScalarProdBase< Scalar > > &scalarProd) |
| Set a different scalar product. | |
| Teuchos::RefCountPtr< const ScalarProdBase< Scalar > > | getScalarProd () const |
| Return the current scalar product. | |
Overridden from VectorSpaceBase | |
| Scalar | scalarProd (const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const |
Calls getScalarProd()->scalarProd(x,y). | |
| void | scalarProds (const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, Scalar scalar_prods[]) const |
Calls getScalarProd()->scalarProds(X,Y,scalar_prods). | |
VectorSpaceBase that allows the definition of an application-specific scalar product to be swapped in and out.
This subclass defines machinery for extracting out the definition of a scalar product as an object that can be replaced. The default implementation of scalar product is the Euclidean scalar product (i.e. dot product). The idea is that, in most cases, the definition of a scalar product may be more general than a specific concrete vector implementation (i.e. a single scalar product may work with all serial and all MPI-based vectors if, for example, it is implemented through an RTOpPack::RTOpT object). Or, a scalar product way work with any MPI SPMD vector or multi-vector. This subclass allows an application code to set a specialized scalar product without having marry a particular concrete vector (vector space) implementation.
Almost every concrete VectorSpaceBase subclass should inherit from this subclass since it makes it easy for application developers to redefine the scalar product without having to create a new VectorSpaceBase subclass which can have many repercussions.
The reason that this machinery in this base subclass is separated out from the VectorSpaceDefaultBase interface class is that, first it would clutter the base interface since this machinery is an implementation artifact and, second, every VectorSpaceBase subclass will not utilize this machinery. For example, composite (see ProductVectorSpaceBase) and decorator subclasses should not derive from this subclass.
Definition at line 70 of file Thyra_ScalarProdVectorSpaceBaseDecl.hpp.
|
|||||||||
|
Construct to use dot product as the default. Postconditions:
Definition at line 42 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
|
||||||||||
|
Construct with a different scalar product. Preconditions:
Postconditions:
Definition at line 47 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
|
||||||||||
|
Set a different scalar product. This function is made virtual so that subclasses can override it and take control of what happens. However, any override should call back on this base implementation to set the actual scalar product object. Preconditions:
Postconditions:
Definition at line 54 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
|
|||||||||
|
Return the current scalar product.
Definition at line 62 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
|
||||||||||||||||
|
Calls
Implements Thyra::VectorSpaceBase< Scalar >. Definition at line 70 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
|
||||||||||||||||||||
|
Calls
Implements Thyra::VectorSpaceBase< Scalar >. Definition at line 80 of file Thyra_ScalarProdVectorSpaceBase.hpp. |
1.3.9.1