Belos::MultiVec< ScalarType > Class Template Reference

Belos's templated pure virtual class for constructing multivectors that are used by the linear solver. More...

#include <BelosMultiVec.hpp>

Inheritance diagram for Belos::MultiVec< ScalarType >:
Inheritance graph
[legend]

List of all members.

Constructor/Destructor



 MultiVec ()
 BelosMultiVec constructor.
virtual ~MultiVec ()
 BelosMultiVec destructor.

Creation methods for new multivectors



virtual MultiVec< ScalarType > * Clone (const int numvecs) const =0
 Creates a new empty BelosMultiVec containing numvecs columns.
virtual MultiVec< ScalarType > * CloneCopy () const =0
 Creates a new BelosMultiVec and copies contents of *this into the new std::vector (deep copy).
virtual MultiVec< ScalarType > * CloneCopy (const std::vector< int > &index) const =0
 Creates a new BelosMultiVec and copies the selected contents of *this into the new std::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 BelosMultiVec that shares the selected contents of *this. The index of the numvecs vectors 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 BelosMultiVec that shares the selected contents of *this. The index of the numvecs vectors copied from *this are indicated by the indices given in index.

Dimension information methods



virtual int GetVecLength () const =0
 Obtain the std::vector length of *this multivector block.
virtual int GetNumberVecs () const =0
 Obtain the number of vectors in *this multivector block.

Update methods



virtual void MvTimesMatAddMv (const ScalarType alpha, const MultiVec< ScalarType > &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta)=0
 Update *this with alpha * A * B + beta * (*this).
virtual void MvAddMv (const ScalarType alpha, const MultiVec< ScalarType > &A, const ScalarType beta, const MultiVec< ScalarType > &B)=0
 Replace *this with alpha * A + beta * B.
virtual void MvScale (const 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 (const 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 a std::vector b where the components are the individual dot-products, i.e.b[i] = A[i]^T*this[i] where A[i] is the i-th column of A.

Norm method



virtual void MvNorm (std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec, NormType type=TwoNorm) const =0
 Compute the 2-norm of each individual std::vector of *this. Upon return, normvec[i] holds the 2-norm of the i-th std::vector of *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. The numvecs vectors in A are copied to a subset of vectors in *this indicated by the indices given in index.
virtual void MvRandom ()=0
 Replace the vectors in *this with random vectors.
virtual void MvInit (const ScalarType alpha)=0
 Replace each element of the vectors in *this with alpha.

Print method



virtual void MvPrint (std::ostream &os) const =0
 Print the *this multivector.

Detailed Description

template<class ScalarType>
class Belos::MultiVec< ScalarType >

Belos's templated pure virtual class for constructing multivectors that are used by the linear solver.

A concrete implementation of this class is necessary. The user can create their own implementation if those supplied are not suitable for their needs.

Author:
Michael Heroux, Rich Lehoucq, Heidi Thornquist

Definition at line 54 of file BelosMultiVec.hpp.


Constructor & Destructor Documentation

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

BelosMultiVec constructor.

Definition at line 59 of file BelosMultiVec.hpp.

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

BelosMultiVec destructor.

Definition at line 62 of file BelosMultiVec.hpp.


Member Function Documentation

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

Creates a new empty BelosMultiVec containing numvecs columns.

Returns:
Pointer to the new multivector with uninitialized values

Implemented in MyMultiVec< ScalarType >.

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

Creates a new BelosMultiVec and copies contents of *this into the new std::vector (deep copy).

Returns:
Pointer to the new multivector

Implemented in MyMultiVec< ScalarType >.

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

Creates a new BelosMultiVec and copies the selected contents of *this into the new std::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 MyMultiVec< ScalarType >.

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

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

Returns:
Pointer to the new multivector

Implemented in MyMultiVec< ScalarType >.

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

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

Returns:
Pointer to the new multivector

Implemented in MyMultiVec< ScalarType >.

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

Obtain the std::vector length of *this multivector block.

Implemented in MyMultiVec< ScalarType >.

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

Obtain the number of vectors in *this multivector block.

Implemented in MyMultiVec< ScalarType >.

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

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

Implemented in MyMultiVec< ScalarType >.

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

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

Implemented in MyMultiVec< ScalarType >.

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

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

Implemented in MyMultiVec< ScalarType >.

template<class ScalarType>
virtual void Belos::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 MyMultiVec< ScalarType >.

template<class ScalarType>
virtual void Belos::MultiVec< ScalarType >::MvTransMv ( const 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 MyMultiVec< ScalarType >.

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

Compute a std::vector b where the components are the individual dot-products, i.e.b[i] = A[i]^T*this[i] where A[i] is the i-th column of A.

Implemented in MyMultiVec< ScalarType >.

template<class ScalarType>
virtual void Belos::MultiVec< ScalarType >::MvNorm ( std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &  normvec,
NormType  type = TwoNorm 
) const [pure virtual]

Compute the 2-norm of each individual std::vector of *this. Upon return, normvec[i] holds the 2-norm of the i-th std::vector of *this.

Implemented in MyMultiVec< ScalarType >.

template<class ScalarType>
virtual void Belos::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 MyMultiVec< ScalarType >.

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

Replace the vectors in *this with random vectors.

Implemented in MyMultiVec< ScalarType >.

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

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

Implemented in MyMultiVec< ScalarType >.

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

Print the *this multivector.

Implemented in MyMultiVec< ScalarType >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:05:18 2011 for Belos Package Browser (Single Doxygen Collection) by  doxygen 1.6.3