Thyra
Version of the Day
|
Forward decl. More...
#include <Thyra_MultiVectorAdapterBase_decl.hpp>
Related Functions | |
(Note that these are not member functions.) | |
template<class Scalar > | |
RCP< const ScalarProdVectorSpaceBase < Scalar > > | createSmallScalarProdVectorSpaceBase (const RCP< const VectorSpaceBase< Scalar > > &vs, const Ordinal dim) |
Create a small vector space casted to ScalarProdVectorSpaceBase. More... | |
Related Functions inherited from Thyra::VectorSpaceBase< Scalar > | |
template<class Scalar > | |
RCP< const VectorSpaceBase < Scalar > > | makeHaveOwnership (const RCP< const VectorSpaceBase< Scalar > > &vs) |
Helper function that clones a VectorSpaceBase object if the RCP does not have ownership. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMember (const RCP< const VectorSpaceBase< Scalar > > &vs, const std::string &label="") |
Create a vector member from the vector space. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMember (const VectorSpaceBase< Scalar > &vs, const std::string &label="") |
Calls createMember(Teuchos::rcp(&vs,false)) . More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const RCP< const VectorSpaceBase< Scalar > > &vs, int numMembers, const std::string &label="") |
Create a set of vector members (a MultiVectorBase ) from the vector space. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const RCP< const VectorSpaceBase< Scalar > > &vs, const RCP< const VectorSpaceBase< Scalar > > &domain, const std::string &label="") |
Create a set of vector members (a MultiVectorBase ) from the vector space. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const VectorSpaceBase< Scalar > &vs, int numMembers, const std::string &label="") |
Calls createMembers(Teuchos::rcp(&vs,false),numMembers) . More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMemberView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubVectorView< Scalar > &raw_v, const std::string &label="") |
Create a vector member that is a non-const view of raw data. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMemberView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::SubVectorView< Scalar > &raw_v, const std::string &label="") |
Calls createMemberView(Teuchos::rcp(&vs,false),raw_v) . More... | |
template<class Scalar > | |
RCP< const VectorBase< Scalar > > | createMemberView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::ConstSubVectorView< Scalar > &raw_v, const std::string &label="") |
Create a vector member that is a const view of raw data. More... | |
template<class Scalar > | |
RCP< const VectorBase< Scalar > > | createMemberView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::ConstSubVectorView< Scalar > &raw_v, const std::string &label="") |
Calls createMemberView(Teuchos::rcp(&vs,false),raw_v) . More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembersView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Create a multi-vector member that is a non-const view of raw data. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembersView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Calls createMembersView(Teuchos::rcp(&vs,false),raw_mv) . More... | |
template<class Scalar > | |
RCP< const MultiVectorBase < Scalar > > | createMembersView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Create a multi-vector member that is a const view of raw data. More... | |
template<class Scalar > | |
RCP< const MultiVectorBase < Scalar > > | createMembersView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Calls createMembersView(Teuchos::rcp(&vs,false),raw_mv) . More... | |
Constructors / initializers | |
ScalarProdVectorSpaceBase () | |
Construct to use dot product as the default. More... | |
ScalarProdVectorSpaceBase (const RCP< const ScalarProdBase< Scalar > > &scalarProd) | |
Construct with a different scalar product. More... | |
virtual void | setScalarProd (const RCP< const ScalarProdBase< Scalar > > &scalarProd) |
Set a different scalar product. More... | |
RCP< const ScalarProdBase < Scalar > > | getScalarProd () const |
Return the current scalar product. More... | |
Overridden from VectorSpaceBase | |
bool | isEuclidean () const |
Returns getScalarProd()->isEuclidean() More... | |
Scalar | scalarProd (const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const |
Returns getScalarProd()->scalarProd(x,y) More... | |
void | scalarProdsImpl (const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const |
Calls getScalarProd()->scalarProds(X,Y,scalar_prods) More... | |
Forward decl.
Base subclass for 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 to depend on a particular concrete vector (and vector space) implementation.
Almost every data-structure centric 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 52 of file Thyra_MultiVectorAdapterBase_decl.hpp.
Thyra::ScalarProdVectorSpaceBase< Scalar >::ScalarProdVectorSpaceBase | ( | ) |
Construct to use dot product as the default.
Postconditions:
dynamic_cast<const EuclideanScalarProd<Scalar>*>(&*this->getScalarProd()) != NULL
Definition at line 58 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
Thyra::ScalarProdVectorSpaceBase< Scalar >::ScalarProdVectorSpaceBase | ( | const RCP< const ScalarProdBase< Scalar > > & | scalarProd | ) |
Construct with a different scalar product.
Preconditions:
scalarProd.get()!=NULL
(throw std::invalid_argument
)
Postconditions:
this->getScalarProd().get() == scalarProd.get()
Definition at line 64 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
|
virtual |
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:
scalarProd.get()!=NULL
(throw std::invalid_argument
)
Postconditions:
this->getScalarProd().get() == scalarProd.get()
Definition at line 72 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
Teuchos::RCP< const ScalarProdBase< Scalar > > Thyra::ScalarProdVectorSpaceBase< Scalar >::getScalarProd | ( | ) | const |
Return the current scalar product.
Definition at line 82 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
|
virtual |
Returns getScalarProd()->isEuclidean()
Reimplemented from Thyra::VectorSpaceBase< Scalar >.
Definition at line 92 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
|
virtual |
Returns getScalarProd()->scalarProd(x,y)
Implements Thyra::VectorSpaceBase< Scalar >.
Definition at line 99 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
|
virtual |
Calls getScalarProd()->scalarProds(X,Y,scalar_prods)
Implements Thyra::VectorSpaceBase< Scalar >.
Definition at line 113 of file Thyra_ScalarProdVectorSpaceBase_def.hpp.
|
related |
Create a small vector space casted to ScalarProdVectorSpaceBase.
Definition at line 177 of file Thyra_ScalarProdVectorSpaceBase_decl.hpp.