Anasazi Version of the Day
Loading...
Searching...
No Matches
List of all members
Anasazi::ThyraMultiVec< ScalarType > Class Template Reference

Basic adapter class for Anasazi::MultiVec that uses Thyra::MultiVectorBase<ScalarType>. More...

#include <AnasaziThyraDebugAdapter.hpp>

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

Public Member Functions

Constructors/Destructors
 ThyraMultiVec (const Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > &mv)
 Basic ThyraMultiVec constructor (wraps Thyra::MultiVectorBase<> object).
 
 ThyraMultiVec (const Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > &mv, std::vector< Teuchos::RCP< Teuchos::Time > > &timers)
 Basic ThyraMultiVec constructor (wraps Thyra::MultiVectorBase<> object).
 
 ThyraMultiVec (const ThyraMultiVec< ScalarType > &mv)
 Copy constructor.
 
virtual ~ThyraMultiVec ()
 Destructor.
 
Creation methods
MultiVec< ScalarType > * Clone (const int numvecs) const
 Creates a new empty ThyraMultiVec containing numvecs columns.
 
MultiVec< ScalarType > * CloneCopy () const
 Creates a new ThyraMultiVec and copies contents of *this into the new vector (deep copy).
 
MultiVec< ScalarType > * CloneCopy (const std::vector< int > &index) const
 Creates a new ThyraMultiVec and copies the selected contents of *this into the new vector (deep copy).
 
MultiVec< ScalarType > * CloneViewNonConst (const std::vector< int > &index)
 Creates a new ThyraMultiVec that shares the selected contents of *this.
 
const MultiVec< ScalarType > * CloneView (const std::vector< int > &index) const
 Creates a new ThyraMultiVec that shares the selected contents of *this.
 
Attribute methods
int GetNumberVecs () const
 Obtain the vector length of *this.
 
ptrdiff_t GetGlobalLength () const
 Obtain the number of vectors in *this.
 
Update methods
void MvTimesMatAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, ScalarType beta)
 Update *this with $\alpha AB + \beta (*this)$.
 
void MvAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, ScalarType beta, const MultiVec< ScalarType > &B)
 Replace *this with $\alpha A + \beta B$.
 
void MvTransMv (ScalarType alpha, const MultiVec< ScalarType > &A, Teuchos::SerialDenseMatrix< int, ScalarType > &B) const
 Compute a dense matrix B through the matrix-matrix multiply $\alpha A^T(*this)$.
 
void MvDot (const MultiVec< ScalarType > &A, std::vector< ScalarType > &b) const
 Compute a vector b where the components are the individual dot-products, i.e. $ b[i] = A[i]^H(this[i])$ where A[i] is the i-th column of A.
 
void MvScale (ScalarType alpha)
 Scale each element of the vectors in *this with alpha.
 
void MvScale (const std::vector< ScalarType > &alpha)
 Scale each element of the i-th vector in *this with alpha[i].
 
Norm method
void MvNorm (std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const
 Compute the 2-norm of each individual vector of *this. Upon return, normvec[i] holds the 2-norm of the i-th vector of *this.
 
Initialization methods
void SetBlock (const MultiVec< ScalarType > &A, const std::vector< int > &index)
 Copy the vectors in A to a set of vectors in *this.
 
void MvRandom ()
 Fill the vectors in *this with random numbers.
 
void MvInit (ScalarType alpha)
 Replace each element of the vectors in *this with alpha.
 
Accessor methods

{

Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > getRCP ()
 Return the reference-counted pointer held by this object.
 
Teuchos::RCP< const Thyra::MultiVectorBase< ScalarType > > getRCP () const
 Return the const reference-counted pointer held by this object.
 
std::vector< Teuchos::RCP< Teuchos::Time > > getTimers () const
 Return a std::vector<> of timers held by this object.
 
void copyTimers (const std::vector< Teuchos::RCP< Teuchos::Time > > &timers)
 Copy a std::vector<> of timers into this object.
 
- Public Member Functions inherited from Anasazi::MultiVec< ScalarType >
 MultiVec ()
 Default constructor.
 
virtual ~MultiVec ()
 Destructor (virtual for memory safety of derived classes).
 

Print method

void MvPrint (std::ostream &os) const
 Print *this ThyraMultiVec.
 

Detailed Description

template<class ScalarType>
class Anasazi::ThyraMultiVec< ScalarType >

Basic adapter class for Anasazi::MultiVec that uses Thyra::MultiVectorBase<ScalarType>.

Note
This adapter is only to be used for debugging purposes. For production use Anasazi::MultiVecTraits templated on Thyra::MultiVectorBase<> and Thyra::LinearOpBase<>.

Definition at line 82 of file AnasaziThyraDebugAdapter.hpp.

Constructor & Destructor Documentation

◆ ThyraMultiVec() [1/3]

template<class ScalarType >
Anasazi::ThyraMultiVec< ScalarType >::ThyraMultiVec ( const Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > & mv)
inline

Basic ThyraMultiVec constructor (wraps Thyra::MultiVectorBase<> object).

Parameters
mv[in] a reference-counted pointer to a Thyra::MultiVectorBase<> object.
Returns
Pointer to a ThyraMultiVec object.

Definition at line 98 of file AnasaziThyraDebugAdapter.hpp.

◆ ThyraMultiVec() [2/3]

template<class ScalarType >
Anasazi::ThyraMultiVec< ScalarType >::ThyraMultiVec ( const Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > & mv,
std::vector< Teuchos::RCP< Teuchos::Time > > & timers )
inline

Basic ThyraMultiVec constructor (wraps Thyra::MultiVectorBase<> object).

Parameters
mv[in] a reference-counted pointer to a Thyra::MultiVectorBase<> object.
timers[in] a vector containing timers for this wrapper to use.
Returns
Pointer to a ThyraMultiVec object.

Definition at line 122 of file AnasaziThyraDebugAdapter.hpp.

◆ ThyraMultiVec() [3/3]

template<class ScalarType >
Anasazi::ThyraMultiVec< ScalarType >::ThyraMultiVec ( const ThyraMultiVec< ScalarType > & mv)
inline

Copy constructor.

Parameters
mv[in] a ThyraMultiVec object.
Returns
Pointer to a ThyraMultiVec object, where the underlying Thyra::MultiVectorBase<> object has been deep copied.

Definition at line 134 of file AnasaziThyraDebugAdapter.hpp.

◆ ~ThyraMultiVec()

template<class ScalarType >
virtual Anasazi::ThyraMultiVec< ScalarType >::~ThyraMultiVec ( )
inlinevirtual

Destructor.

Definition at line 142 of file AnasaziThyraDebugAdapter.hpp.

Member Function Documentation

◆ Clone()

template<class ScalarType >
MultiVec< ScalarType > * Anasazi::ThyraMultiVec< ScalarType >::Clone ( const int numvecs) const
inlinevirtual

Creates a new empty ThyraMultiVec containing numvecs columns.

Returns
Pointer to an ThyraMultiVec

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 153 of file AnasaziThyraDebugAdapter.hpp.

◆ CloneCopy() [1/2]

template<class ScalarType >
MultiVec< ScalarType > * Anasazi::ThyraMultiVec< ScalarType >::CloneCopy ( ) const
inlinevirtual

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

Returns
Pointer to an ThyraMultiVec

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 164 of file AnasaziThyraDebugAdapter.hpp.

◆ CloneCopy() [2/2]

template<class ScalarType >
MultiVec< ScalarType > * Anasazi::ThyraMultiVec< ScalarType >::CloneCopy ( const std::vector< int > & index) const
inlinevirtual

Creates a new ThyraMultiVec 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 an ThyraMultiVec

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 178 of file AnasaziThyraDebugAdapter.hpp.

◆ CloneViewNonConst()

template<class ScalarType >
MultiVec< ScalarType > * Anasazi::ThyraMultiVec< ScalarType >::CloneViewNonConst ( const std::vector< int > & index)
inlinevirtual

Creates a new ThyraMultiVec 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 an ThyraMultiVec

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 192 of file AnasaziThyraDebugAdapter.hpp.

◆ CloneView()

template<class ScalarType >
const MultiVec< ScalarType > * Anasazi::ThyraMultiVec< ScalarType >::CloneView ( const std::vector< int > & index) const
inlinevirtual

Creates a new ThyraMultiVec 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 an ThyraMultiVec

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 206 of file AnasaziThyraDebugAdapter.hpp.

◆ GetNumberVecs()

template<class ScalarType >
int Anasazi::ThyraMultiVec< ScalarType >::GetNumberVecs ( ) const
inlinevirtual

Obtain the vector length of *this.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 221 of file AnasaziThyraDebugAdapter.hpp.

◆ GetGlobalLength()

template<class ScalarType >
ptrdiff_t Anasazi::ThyraMultiVec< ScalarType >::GetGlobalLength ( ) const
inlinevirtual

Obtain the number of vectors in *this.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 224 of file AnasaziThyraDebugAdapter.hpp.

◆ MvTimesMatAddMv()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvTimesMatAddMv ( ScalarType alpha,
const MultiVec< ScalarType > & A,
const Teuchos::SerialDenseMatrix< int, ScalarType > & B,
ScalarType beta )
inlinevirtual

Update *this with $\alpha AB + \beta (*this)$.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 232 of file AnasaziThyraDebugAdapter.hpp.

◆ MvAddMv()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvAddMv ( ScalarType alpha,
const MultiVec< ScalarType > & A,
ScalarType beta,
const MultiVec< ScalarType > & B )
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 243 of file AnasaziThyraDebugAdapter.hpp.

◆ MvTransMv()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvTransMv ( ScalarType alpha,
const MultiVec< ScalarType > & A,
Teuchos::SerialDenseMatrix< int, ScalarType > & B ) const
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 254 of file AnasaziThyraDebugAdapter.hpp.

◆ MvDot()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvDot ( const MultiVec< ScalarType > & A,
std::vector< ScalarType > & b ) const
inlinevirtual

Compute a vector b where the components are the individual dot-products, i.e. $ b[i] = A[i]^H(this[i])$ where A[i] is the i-th column of A.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 267 of file AnasaziThyraDebugAdapter.hpp.

◆ MvScale() [1/2]

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvScale ( ScalarType alpha)
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 280 of file AnasaziThyraDebugAdapter.hpp.

◆ MvScale() [2/2]

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvScale ( const std::vector< ScalarType > & alpha)
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 284 of file AnasaziThyraDebugAdapter.hpp.

◆ MvNorm()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvNorm ( std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > & normvec) const
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 293 of file AnasaziThyraDebugAdapter.hpp.

◆ SetBlock()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::SetBlock ( const MultiVec< ScalarType > & A,
const std::vector< int > & index )
inlinevirtual

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.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 303 of file AnasaziThyraDebugAdapter.hpp.

◆ MvRandom()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvRandom ( )
inlinevirtual

Fill the vectors in *this with random numbers.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 312 of file AnasaziThyraDebugAdapter.hpp.

◆ MvInit()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvInit ( ScalarType alpha)
inlinevirtual

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

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 316 of file AnasaziThyraDebugAdapter.hpp.

◆ getRCP() [1/2]

template<class ScalarType >
Teuchos::RCP< Thyra::MultiVectorBase< ScalarType > > Anasazi::ThyraMultiVec< ScalarType >::getRCP ( )
inline

Return the reference-counted pointer held by this object.

Definition at line 322 of file AnasaziThyraDebugAdapter.hpp.

◆ getRCP() [2/2]

template<class ScalarType >
Teuchos::RCP< const Thyra::MultiVectorBase< ScalarType > > Anasazi::ThyraMultiVec< ScalarType >::getRCP ( ) const
inline

Return the const reference-counted pointer held by this object.

Definition at line 326 of file AnasaziThyraDebugAdapter.hpp.

◆ getTimers()

template<class ScalarType >
std::vector< Teuchos::RCP< Teuchos::Time > > Anasazi::ThyraMultiVec< ScalarType >::getTimers ( ) const
inline

Return a std::vector<> of timers held by this object.

Definition at line 330 of file AnasaziThyraDebugAdapter.hpp.

◆ copyTimers()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::copyTimers ( const std::vector< Teuchos::RCP< Teuchos::Time > > & timers)
inline

Copy a std::vector<> of timers into this object.

Definition at line 350 of file AnasaziThyraDebugAdapter.hpp.

◆ MvPrint()

template<class ScalarType >
void Anasazi::ThyraMultiVec< ScalarType >::MvPrint ( std::ostream & os) const
inlinevirtual

Print *this ThyraMultiVec.

Implements Anasazi::MultiVec< ScalarType >.

Definition at line 371 of file AnasaziThyraDebugAdapter.hpp.


The documentation for this class was generated from the following file: