Belos Version of the Day
Loading...
Searching...
No Matches
Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > > Class Template Reference

Specialization of MultiVecTraits for Belos::MultiVec. More...

#include <BelosMultiVec.hpp>

Inheritance diagram for Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >:

Static Public Member Functions

Creation methods
static Teuchos::RCP< MultiVec< ScalarType > > Clone (const MultiVec< ScalarType > &mv, const int numvecs)
 Create a new empty MultiVec containing numvecs columns.
static Teuchos::RCP< MultiVec< ScalarType > > CloneCopy (const MultiVec< ScalarType > &mv)
static Teuchos::RCP< MultiVec< ScalarType > > CloneCopy (const MultiVec< ScalarType > &mv, const std::vector< int > &index)
static Teuchos::RCP< MultiVec< ScalarType > > CloneViewNonConst (MultiVec< ScalarType > &mv, const std::vector< int > &index)
static Teuchos::RCP< MultiVec< ScalarType > > CloneViewNonConst (MultiVec< ScalarType > &mv, const Teuchos::Range1D &index)
static Teuchos::RCP< const MultiVec< ScalarType > > CloneView (const MultiVec< ScalarType > &mv, const std::vector< int > &index)
static Teuchos::RCP< const MultiVec< ScalarType > > CloneView (const MultiVec< ScalarType > &mv, const Teuchos::Range1D &index)
static ptrdiff_t GetGlobalLength (const MultiVec< ScalarType > &mv)
static int GetNumberVecs (const MultiVec< ScalarType > &mv)
static void MvTimesMatAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, ScalarType beta, MultiVec< ScalarType > &mv)
static void MvAddMv (ScalarType alpha, const MultiVec< ScalarType > &A, ScalarType beta, const MultiVec< ScalarType > &B, MultiVec< ScalarType > &mv)
static void MvScale (MultiVec< ScalarType > &mv, const ScalarType alpha)
static void MvScale (MultiVec< ScalarType > &mv, const std::vector< ScalarType > &alpha)
static void MvTransMv (const ScalarType alpha, const MultiVec< ScalarType > &A, const MultiVec< ScalarType > &mv, Teuchos::SerialDenseMatrix< int, ScalarType > &B)
static void MvDot (const MultiVec< ScalarType > &mv, const MultiVec< ScalarType > &A, std::vector< ScalarType > &b)
static void MvNorm (const MultiVec< ScalarType > &mv, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec, NormType type=TwoNorm)
static void SetBlock (const MultiVec< ScalarType > &A, const std::vector< int > &index, MultiVec< ScalarType > &mv)
static void Assign (const MultiVec< ScalarType > &A, MultiVec< ScalarType > &mv)
static void MvRandom (MultiVec< ScalarType > &mv)
static void MvInit (MultiVec< ScalarType > &mv, ScalarType alpha=Teuchos::ScalarTraits< ScalarType >::zero())
static void MvPrint (const MultiVec< ScalarType > &mv, std::ostream &os)
Attribute methods
static bool HasConstantStride (const MultiVec< ScalarType > &mv)
 Whether the given multivector mv has constant stride.

Detailed Description

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

Specialization of MultiVecTraits for Belos::MultiVec.

Belos interfaces to every multivector implementation through a specialization of MultiVecTraits. Thus, we provide a specialization of MultiVecTraits for the MultiVec run-time polymorphic interface above.

Template Parameters
ScalarTypeThe type of entries in the multivector; the template parameter of MultiVec.

Definition at line 332 of file BelosMultiVec.hpp.

Member Function Documentation

◆ Clone()

template<class ScalarType>
Teuchos::RCP< MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::Clone ( const MultiVec< ScalarType > & mv,
const int numvecs )
inlinestatic

Create a new empty MultiVec containing numvecs columns.

Returns
Reference-counted pointer to the new MultiVec.

Definition at line 340 of file BelosMultiVec.hpp.

◆ CloneCopy() [1/2]

template<class ScalarType>
Teuchos::RCP< MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneCopy ( const MultiVec< ScalarType > & mv)
inlinestatic

Definition at line 344 of file BelosMultiVec.hpp.

◆ CloneCopy() [2/2]

template<class ScalarType>
Teuchos::RCP< MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneCopy ( const MultiVec< ScalarType > & mv,
const std::vector< int > & index )
inlinestatic

Definition at line 347 of file BelosMultiVec.hpp.

◆ CloneViewNonConst() [1/2]

template<class ScalarType>
Teuchos::RCP< MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneViewNonConst ( MultiVec< ScalarType > & mv,
const std::vector< int > & index )
inlinestatic

Definition at line 351 of file BelosMultiVec.hpp.

◆ CloneViewNonConst() [2/2]

template<class ScalarType>
Teuchos::RCP< MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneViewNonConst ( MultiVec< ScalarType > & mv,
const Teuchos::Range1D & index )
inlinestatic

Definition at line 357 of file BelosMultiVec.hpp.

◆ CloneView() [1/2]

template<class ScalarType>
Teuchos::RCP< const MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneView ( const MultiVec< ScalarType > & mv,
const std::vector< int > & index )
inlinestatic

Definition at line 371 of file BelosMultiVec.hpp.

◆ CloneView() [2/2]

template<class ScalarType>
Teuchos::RCP< const MultiVec< ScalarType > > Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::CloneView ( const MultiVec< ScalarType > & mv,
const Teuchos::Range1D & index )
inlinestatic

Definition at line 376 of file BelosMultiVec.hpp.

◆ GetGlobalLength()

template<class ScalarType>
ptrdiff_t Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::GetGlobalLength ( const MultiVec< ScalarType > & mv)
inlinestatic

Definition at line 389 of file BelosMultiVec.hpp.

◆ GetNumberVecs()

template<class ScalarType>
int Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::GetNumberVecs ( const MultiVec< ScalarType > & mv)
inlinestatic

Definition at line 392 of file BelosMultiVec.hpp.

◆ MvTimesMatAddMv()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvTimesMatAddMv ( ScalarType alpha,
const MultiVec< ScalarType > & A,
const Teuchos::SerialDenseMatrix< int, ScalarType > & B,
ScalarType beta,
MultiVec< ScalarType > & mv )
inlinestatic

Definition at line 395 of file BelosMultiVec.hpp.

◆ MvAddMv()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvAddMv ( ScalarType alpha,
const MultiVec< ScalarType > & A,
ScalarType beta,
const MultiVec< ScalarType > & B,
MultiVec< ScalarType > & mv )
inlinestatic

Definition at line 400 of file BelosMultiVec.hpp.

◆ MvScale() [1/2]

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvScale ( MultiVec< ScalarType > & mv,
const ScalarType alpha )
inlinestatic

Definition at line 403 of file BelosMultiVec.hpp.

◆ MvScale() [2/2]

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvScale ( MultiVec< ScalarType > & mv,
const std::vector< ScalarType > & alpha )
inlinestatic

Definition at line 406 of file BelosMultiVec.hpp.

◆ MvTransMv()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvTransMv ( const ScalarType alpha,
const MultiVec< ScalarType > & A,
const MultiVec< ScalarType > & mv,
Teuchos::SerialDenseMatrix< int, ScalarType > & B )
inlinestatic

Definition at line 409 of file BelosMultiVec.hpp.

◆ MvDot()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvDot ( const MultiVec< ScalarType > & mv,
const MultiVec< ScalarType > & A,
std::vector< ScalarType > & b )
inlinestatic

Definition at line 412 of file BelosMultiVec.hpp.

◆ MvNorm()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvNorm ( const MultiVec< ScalarType > & mv,
std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > & normvec,
NormType type = TwoNorm )
inlinestatic

Definition at line 415 of file BelosMultiVec.hpp.

◆ SetBlock()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::SetBlock ( const MultiVec< ScalarType > & A,
const std::vector< int > & index,
MultiVec< ScalarType > & mv )
inlinestatic

Definition at line 418 of file BelosMultiVec.hpp.

◆ Assign()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::Assign ( const MultiVec< ScalarType > & A,
MultiVec< ScalarType > & mv )
inlinestatic

Definition at line 422 of file BelosMultiVec.hpp.

◆ MvRandom()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvRandom ( MultiVec< ScalarType > & mv)
inlinestatic

Definition at line 446 of file BelosMultiVec.hpp.

◆ MvInit()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvInit ( MultiVec< ScalarType > & mv,
ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
inlinestatic

Definition at line 449 of file BelosMultiVec.hpp.

◆ MvPrint()

template<class ScalarType>
void Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::MvPrint ( const MultiVec< ScalarType > & mv,
std::ostream & os )
inlinestatic

Definition at line 452 of file BelosMultiVec.hpp.

◆ HasConstantStride()

bool Belos::MultiVecTraits< ScalarType, MultiVec< ScalarType > >::HasConstantStride ( const MultiVec< ScalarType > & mv)
inlinestatic

Whether the given multivector mv has constant stride.

Parameters
mv[in] Multivector to check

Knowing whether mv has constant stride is useful for certain orthogonalization methods, for example.

Note
(mfh 13 Jan 2011) This is really a hack for TSQR, which currently can only process multivectors with constant stride. Fixing this can be done in a few different ways:
  • Copy the entire multivector into a constant-stride multivector (performance penalty for copying in and out, storage penalty of one multivector, but easy to implement)
  • Copying "cache blocks" in and out of constant-stride storage (some performance penalty, storage penalty << one multivector, requires a new variant of TSQR::SequentialTsqr and perhaps a restructuring of the TSQR has-a hierarchy)
  • Writing an implementation / back-end of TSQR::Combine that can handle cache blocks not of constant stride. Like the above, a bit more work, but without the copy in/out performance penalty for cache blocks, and doesn't require an extra cache block's worth of storage.

Definition at line 211 of file BelosMultiVecTraits.hpp.


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

Generated on for Belos by doxygen 1.15.0