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

Handle class for VectorSpaceBase. More...

#include <Thyra_VectorSpaceDecl.hpp>

Inheritance diagram for Thyra::VectorSpace< Scalar >:

[legend]
List of all members.

Public Member Functions

Vector< Scalar > createMember () const
 Create a new element of this std::vector space.
Teuchos::RCP< MultiVectorBase<
Scalar > > 
createMembers (int n) const
 Create a multivector in this std::vector space.
int dim () const
 Return the dimension of the space.
bool isCompatible (const VectorSpace< Scalar > &vecSpc) const
 Check compatibility with another space.
bool isInCore () const
 Tell if vectors of this space are in core.
bool operator== (const VectorSpace< Scalar > &other) const
 Test equality between two spaces.
bool operator!= (const VectorSpace< Scalar > &other) const
 Test inequality of two spaces.
bool contains (const Vector< Scalar > &vec) const
 Test whether the space contains a given std::vector.
int numBlocks () const
 Return the number of std::vector space subblocks.
VectorSpace< Scalar > getBlock (int k) const
 Get the k-th subblock where (0 <= k < numBlocks()).
void setBlock (int k, const VectorSpace< Scalar > &space)
 Set the k-th subblock where (0 <= k < numBlocks()).

Related Functions

(Note that these are not member functions.)

Vector< Scalar > createMember (const VectorSpace< Scalar > &space)
 Create a member.
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
productSpace (const Teuchos::Array< VectorSpace< Scalar > > &spaces)
 Create a product space given an array of std::vector spaces blocks.
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
productSpace (VectorSpace< Scalar > &s1)
 Create a product space given a single std::vector space block.
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
productSpace (VectorSpace< Scalar > &s1, VectorSpace< Scalar > &s2)
 Create a product space given two std::vector space blocks.
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
productSpace (VectorSpace< Scalar > &s1, VectorSpace< Scalar > &s2, VectorSpace< Scalar > &s3)
 Create a product space given three std::vector space blocks.
int lowestLocallyOwnedIndex (const VectorSpace< Scalar > &s)
 Returns the lowest global index accessible on this processor. This function will throw an std::exception if the space is not a SpmdVectorSpaceBase.
int numLocalElements (const VectorSpace< Scalar > &s)
 Return the number of elements owned by this processor. This function will throw an std::exception if the space is not a SpmdVectorSpaceBase.
bool indexIsLocal (const VectorSpace< Scalar > &s, Index i)
 Test whether a specified index is local to this processor.
bool isSPMD (const VectorSpace< Scalar > &s)
 Test whether a std::vector space is an atomic SPMD object.

Detailed Description

template<class Scalar>
class Thyra::VectorSpace< Scalar >

Handle class for VectorSpaceBase.
Examples:

silliestCgSolve.hpp.


Member Function Documentation

template<class Scalar>
Vector< Scalar > Thyra::VectorSpace< Scalar >::createMember  )  const [inline]
 

Create a new element of this std::vector space.

template<class Scalar>
RCP< MultiVectorBase< Scalar > > Thyra::VectorSpace< Scalar >::createMembers int  n  )  const [inline]
 

Create a multivector in this std::vector space.

Note: There is not yet a handle class for multi-vectors yet and therefore this function returns Teuchos::RCP object to the created raw MultiVectorBase object. In the future, this will be replaced to return a true Thyra::MultiVector handle object onces this class is created.

template<class Scalar>
int Thyra::VectorSpace< Scalar >::dim  )  const [inline]
 

Return the dimension of the space.

template<class Scalar>
bool Thyra::VectorSpace< Scalar >::isCompatible const VectorSpace< Scalar > &  vecSpc  )  const [inline]
 

Check compatibility with another space.

Implementation note: we don't know if the argument vec space is a handle to another std::vector space or the contents of a handle, and we want the operation to work the same in either case. We can make this work as follows: have the argument check compatibility with the contents of this handle. If the argument is a handle, the process will be repeated, interchanging places again so that both handles are dereferenced. If the argument is not a handle, then it ends up comparing to the concrete contents of this handle, giving the same results.

template<class Scalar>
bool Thyra::VectorSpace< Scalar >::isInCore  )  const [inline]
 

Tell if vectors of this space are in core.

template<class Scalar>
bool Thyra::VectorSpace< Scalar >::operator== const VectorSpace< Scalar > &  other  )  const [inline]
 

Test equality between two spaces.

template<class Scalar>
bool Thyra::VectorSpace< Scalar >::operator!= const VectorSpace< Scalar > &  other  )  const [inline]
 

Test inequality of two spaces.

template<class Scalar>
bool Thyra::VectorSpace< Scalar >::contains const Vector< Scalar > &  vec  )  const [inline]
 

Test whether the space contains a given std::vector.

template<class Scalar>
int Thyra::VectorSpace< Scalar >::numBlocks  )  const [inline]
 

Return the number of std::vector space subblocks.

template<class Scalar>
VectorSpace< Scalar > Thyra::VectorSpace< Scalar >::getBlock int  k  )  const [inline]
 

Get the k-th subblock where (0 <= k < numBlocks()).

template<class Scalar>
void Thyra::VectorSpace< Scalar >::setBlock int  k,
const VectorSpace< Scalar > &  space
 

Set the k-th subblock where (0 <= k < numBlocks()).


Friends And Related Function Documentation

template<class Scalar>
Vector< Scalar > createMember const VectorSpace< Scalar > &  space  )  [related]
 

Create a member.

template<class Scalar>
Teuchos::RCP< const VectorSpaceBase< Scalar > > productSpace const Teuchos::Array< VectorSpace< Scalar > > &  spaces  )  [related]
 

Create a product space given an array of std::vector spaces blocks.

template<class Scalar>
Teuchos::RCP< const VectorSpaceBase< Scalar > > productSpace VectorSpace< Scalar > &  s1  )  [related]
 

Create a product space given a single std::vector space block.

template<class Scalar>
Teuchos::RCP< const VectorSpaceBase< Scalar > > productSpace VectorSpace< Scalar > &  s1,
VectorSpace< Scalar > &  s2
[related]
 

Create a product space given two std::vector space blocks.

template<class Scalar>
Teuchos::RCP< const VectorSpaceBase< Scalar > > productSpace VectorSpace< Scalar > &  s1,
VectorSpace< Scalar > &  s2,
VectorSpace< Scalar > &  s3
[related]
 

Create a product space given three std::vector space blocks.

template<class Scalar>
int lowestLocallyOwnedIndex const VectorSpace< Scalar > &  s  )  [related]
 

Returns the lowest global index accessible on this processor. This function will throw an std::exception if the space is not a SpmdVectorSpaceBase.

Preconditions:

  • isSPMD(s)==true

template<class Scalar>
int numLocalElements const VectorSpace< Scalar > &  s  )  [related]
 

Return the number of elements owned by this processor. This function will throw an std::exception if the space is not a SpmdVectorSpaceBase.

Preconditions:

  • isSPMD(s)==true

template<class Scalar>
bool indexIsLocal const VectorSpace< Scalar > &  s,
Index  i
[related]
 

Test whether a specified index is local to this processor.

template<class Scalar>
bool isSPMD const VectorSpace< Scalar > &  s  )  [related]
 

Test whether a std::vector space is an atomic SPMD object.


The documentation for this class was generated from the following files:
Generated on Sun Nov 23 12:13:07 2008 for Thyra Operator/Vector Support by  doxygen 1.3.9.1