Anasazi Version of the Day
Anasazi::MultiVec< ScalarType > Class Template Reference

Interface for multivectors used by Anasazi's linear solvers. More...

#include <AnasaziMultiVec.hpp>

Inheritance diagram for Anasazi::MultiVec< ScalarType >:
Anasazi::ThyraMultiVec< ScalarType >

List of all members.

Public Member Functions

Constructor/Destructor
 MultiVec ()
 Default constructor.
virtual ~MultiVec ()
 Destructor (virtual for memory safety of derived classes).
Creation methods
virtual MultiVec< ScalarType > * Clone (const int numvecs) const =0
 Create a new MultiVec with numvecs columns.
virtual MultiVec< ScalarType > * CloneCopy () const =0
 Create a new MultiVec and copy contents of *this into it (deep copy).
virtual MultiVec< ScalarType > * CloneCopy (const std::vector< int > &index) const =0
 Creates a new Anasazi::MultiVec and copies the selected contents of *this into the new vector (deep copy). The copied vectors from *this are indicated by the index.size() indices in index.
virtual MultiVec< ScalarType > * CloneViewNonConst (const std::vector< int > &index)=0
 Creates a new Anasazi::MultiVec that shares the selected contents of *this. The index of the numvecs vectors shallow copied from *this are indicated by the indices given in index.
virtual const MultiVec
< ScalarType > * 
CloneView (const std::vector< int > &index) const =0
 Creates a new Anasazi::MultiVec that shares the selected contents of *this. The index of the numvecs vectors shallow copied from *this are indicated by the indices given in index.
Dimension information methods
virtual int GetVecLength () const =0
 The number of rows in the multivector.
virtual ptrdiff_t GetGlobalLength () const
virtual int GetNumberVecs () const =0
 The number of vectors (i.e., columns) in the multivector.
Update methods
virtual void MvTimesMatAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, ScalarType beta)=0
 Update *this with alpha * A * B + beta * (*this).
virtual void MvAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, ScalarType beta, const MultiVec< ScalarType > &B)=0
 Replace *this with alpha * A + beta * B.
virtual void MvScale (ScalarType alpha)=0
 Scale each element of the vectors in *this with alpha.
virtual void MvScale (const std::vector< ScalarType > &alpha)=0
 Scale each element of the i-th vector in *this with alpha[i].
virtual void MvTransMv (ScalarType alpha, const MultiVec< ScalarType > &A, Teuchos::SerialDenseMatrix< int, ScalarType > &B) const =0
 Compute a dense matrix B through the matrix-matrix multiply alpha * A^T * (*this).
virtual void MvDot (const MultiVec< ScalarType > &A, std::vector< ScalarType > &b) const =0
 Compute the dot product of each column of *this with the corresponding column of A.
Norm method
virtual void MvNorm (std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const =0
 Compute the 2-norm of each vector in *this.
Initialization methods
virtual void SetBlock (const MultiVec< ScalarType > &A, const std::vector< int > &index)=0
 Copy the vectors in A to a set of vectors in *this.
virtual void MvRandom ()=0
 Fill all the vectors in *this with random numbers.
virtual void MvInit (ScalarType alpha)=0
 Replace each element of the vectors in *this with alpha.
Print method
virtual void MvPrint (std::ostream &os) const =0
 Print *this multivector to the os output stream.

Detailed Description

template<class ScalarType>
class Anasazi::MultiVec< ScalarType >

Interface for multivectors used by Anasazi's linear solvers.

Author:
Ulrich Hetmaniuk, Rich Lehoucq, and Heidi Thornquist
Template Parameters:
ScalarTypeThe type of entries of the multivector.

Anasazi accesses multivectors through a traits interface called MultiVecTraits. If you want to use Anasazi with your own multivector class MV, you may either specialize MultiVecTraits for MV, or you may wrap MV in your own class that implements MultiVec. Specializing MultiVecTraits works via compile-time polymorphism, whereas implementing the MultiVec interface works via run-time polymorphism. You may pick whichever option you like. However, specializing MultiVecTraits is the preferred method. This is because Anasazi's linear solvers always use a specialization of MultiVecTraits to access multivector operations. They only use MultiVec through a specialization of the MultiVecTraits traits class, which is implemented below in this header file.

If you want your multivector class (or a wrapper thereof) to implement the MultiVec interface, you should inherit from MultiVec<ScalarType>, where ScalarType is the type of entries in the multivector. For example, a multivector with entries of type double would inherit from MultiVec<double>.

Definition at line 77 of file AnasaziMultiVec.hpp.


Constructor & Destructor Documentation

template<class ScalarType>
Anasazi::MultiVec< ScalarType >::MultiVec ( ) [inline]

Default constructor.

Definition at line 82 of file AnasaziMultiVec.hpp.

template<class ScalarType>
virtual Anasazi::MultiVec< ScalarType >::~MultiVec ( ) [inline, virtual]

Destructor (virtual for memory safety of derived classes).

Definition at line 85 of file AnasaziMultiVec.hpp.


Member Function Documentation

template<class ScalarType>
virtual MultiVec<ScalarType>* Anasazi::MultiVec< ScalarType >::Clone ( const int  numvecs) const [pure virtual]

Create a new MultiVec with numvecs columns.

Returns:
Pointer to the new multivector with uninitialized values.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual MultiVec<ScalarType>* Anasazi::MultiVec< ScalarType >::CloneCopy ( ) const [pure virtual]

Create a new MultiVec and copy contents of *this into it (deep copy).

Returns:
Pointer to the new multivector

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual MultiVec<ScalarType>* Anasazi::MultiVec< ScalarType >::CloneCopy ( const std::vector< int > &  index) const [pure virtual]

Creates a new Anasazi::MultiVec and copies the selected contents of *this into the new vector (deep copy). The copied vectors from *this are indicated by the index.size() indices in index.

Returns:
Pointer to the new multivector

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual MultiVec<ScalarType>* Anasazi::MultiVec< ScalarType >::CloneViewNonConst ( const std::vector< int > &  index) [pure virtual]

Creates a new Anasazi::MultiVec that shares the selected contents of *this. The index of the numvecs vectors shallow copied from *this are indicated by the indices given in index.

Returns:
Pointer to the new multivector

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual const MultiVec<ScalarType>* Anasazi::MultiVec< ScalarType >::CloneView ( const std::vector< int > &  index) const [pure virtual]

Creates a new Anasazi::MultiVec that shares the selected contents of *this. The index of the numvecs vectors shallow copied from *this are indicated by the indices given in index.

Returns:
Pointer to the new multivector

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual int Anasazi::MultiVec< ScalarType >::GetVecLength ( ) const [pure virtual]

The number of rows in the multivector.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual ptrdiff_t Anasazi::MultiVec< ScalarType >::GetGlobalLength ( ) const [inline, virtual]

The number of rows in the multivector.

Note:
This method supersedes GetVecLength, which will be deprecated.

Reimplemented in Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

Definition at line 132 of file AnasaziMultiVec.hpp.

template<class ScalarType>
virtual int Anasazi::MultiVec< ScalarType >::GetNumberVecs ( ) const [pure virtual]

The number of vectors (i.e., columns) in the multivector.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvTimesMatAddMv ( ScalarType  alpha,
const MultiVec< ScalarType > &  A,
const Teuchos::SerialDenseMatrix< int, ScalarType > &  B,
ScalarType  beta 
) [pure virtual]

Update *this with alpha * A * B + beta * (*this).

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvAddMv ( ScalarType  alpha,
const MultiVec< ScalarType > &  A,
ScalarType  beta,
const MultiVec< ScalarType > &  B 
) [pure virtual]

Replace *this with alpha * A + beta * B.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvScale ( ScalarType  alpha) [pure virtual]

Scale each element of the vectors in *this with alpha.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvScale ( const std::vector< ScalarType > &  alpha) [pure virtual]

Scale each element of the i-th vector in *this with alpha[i].

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvTransMv ( ScalarType  alpha,
const MultiVec< ScalarType > &  A,
Teuchos::SerialDenseMatrix< int, ScalarType > &  B 
) const [pure virtual]

Compute a dense matrix B through the matrix-matrix multiply alpha * A^T * (*this).

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvDot ( const MultiVec< ScalarType > &  A,
std::vector< ScalarType > &  b 
) const [pure virtual]

Compute the dot product of each column of *this with the corresponding column of A.

Compute a vector b whose entries are the individual dot-products. That is, b[i] = A[i]^H * (*this)[i] where A[i] is the i-th column of A.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvNorm ( std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &  normvec) const [pure virtual]

Compute the 2-norm of each vector in *this.

Parameters:
normvec[out] On output, normvec[i] holds the 2-norm of the i-th vector of *this.

Implemented in Anasazi::ThyraMultiVec< ScalarType >.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::SetBlock ( const MultiVec< ScalarType > &  A,
const std::vector< int > &  index 
) [pure virtual]

Copy the vectors in A to a set of vectors in *this.

The numvecs vectors in A are copied to a subset of vectors in *this indicated by the indices given in index.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvRandom ( ) [pure virtual]

Fill all the vectors in *this with random numbers.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvInit ( ScalarType  alpha) [pure virtual]

Replace each element of the vectors in *this with alpha.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.

template<class ScalarType>
virtual void Anasazi::MultiVec< ScalarType >::MvPrint ( std::ostream &  os) const [pure virtual]

Print *this multivector to the os output stream.

Implemented in Anasazi::ThyraMultiVec< ScalarType >, Anasazi::EpetraMultiVec, and Anasazi::EpetraOpMultiVec.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends