Static Public Member Functions | List of all members
Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector > Class Reference

Specialize the Anasazi traits class for the oomph-lib DoubleMultiVector. This provides the interfaces required by the Anasazi eigensolvers. More...

#include <trilinos_eigen_solver.h>

Static Public Member Functions

static Teuchos::RCP< oomph::DoubleMultiVectorClone (const oomph::DoubleMultiVector &mv, const int numvecs)
 Creates a new empty DoubleMultiVector containing numvecs columns. Return a reference-counted pointer to the new multivector.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneCopy (const oomph::DoubleMultiVector &mv)
 Creates a deep copy of the DoubleMultiVector mv return Reference-counted pointer to the new DoubleMultiVector.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneCopy (const oomph::DoubleMultiVector &mv, const std::vector< int > &index)
 Creates a new oomph::DoubleMultiVector and (deep) copies the contents of the vectors in index into the new vector return Reference-counted pointer to the new oomph::DoubleMultiVector.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneCopy (const oomph::DoubleMultiVector &mv, const Teuchos::Range1D &index)
 Deep copy of specified columns of oomph::DoubleMultiVector return Reference-counted pointer to the new oomph::DoubleMultiVector.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneViewNonConst (oomph::DoubleMultiVector &mv, const std::vector< int > &index)
 Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneViewNonConst (oomph::DoubleMultiVector &mv, const Teuchos::Range1D &index)
 Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector.
 
static Teuchos::RCP< const oomph::DoubleMultiVectorCloneView (const oomph::DoubleMultiVector &mv, const std::vector< int > &index)
 Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (const version)
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneView (oomph::DoubleMultiVector &mv, const std::vector< int > &index)
 Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (Non-const version for Trilinos 9 interface) NOTE: Not required in Trilinos 13.4.0.
 
static Teuchos::RCP< oomph::DoubleMultiVectorCloneView (oomph::DoubleMultiVector &mv, const Teuchos::Range1D &index)
 Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (const version)
 
static int GetVecLength (const oomph::DoubleMultiVector &mv)
 Obtain the global length of the vector.
 
static ptrdiff_t GetGlobalLength (const oomph::DoubleMultiVector &mv)
 Return the number of rows in the given multivector. NOTE: Trilinos 13.4.0 uses GetGlobalLength instead of GetVecLength.
 
static int GetNumberVecs (const oomph::DoubleMultiVector &mv)
 Obtain the number of vectors in the multivector.
 
static void MvTimesMatAddMv (const double alpha, const oomph::DoubleMultiVector &A, const Teuchos::SerialDenseMatrix< int, double > &B, const double beta, oomph::DoubleMultiVector &mv)
 Update mv with $ \alpha AB + \beta mv $.
 
static void MvAddMv (const double alpha, const oomph::DoubleMultiVector &A, const double beta, const oomph::DoubleMultiVector &B, oomph::DoubleMultiVector &mv)
 Replace mv with $\alpha A + \beta B$.
 
static void MvScale (oomph::DoubleMultiVector &mv, const double alpha)
 Scale each element of the vectors in mv with alpha.
 
static void MvScale (oomph::DoubleMultiVector &mv, const std::vector< double > &alpha)
 Scale each element of the i-th vector in mv with alpha[i].
 
static void MvTransMv (const double alpha, const oomph::DoubleMultiVector &A, const oomph::DoubleMultiVector &mv, Teuchos::SerialDenseMatrix< int, double > &B)
 Compute a dense matrix B through the matrix-matrix multiply $ \alpha A^Hmv $.
 
static void MvDot (const oomph::DoubleMultiVector &mv, const oomph::DoubleMultiVector &A, std::vector< double > &b)
 Compute a vector b where the components are the individual dot-products of the i-th columns of A and mv, i.e. $ b[i] = * A[i]^Hmv[i] $.
 
static void MvNorm (const oomph::DoubleMultiVector &mv, std::vector< double > &normvec)
 Compute the 2-norm of each individual vector of mv. Upon return, normvec[i] holds the value of $||mv_i||_2$, the i-th column of mv.
 
Initialization methods
static void SetBlock (const oomph::DoubleMultiVector &A, const std::vector< int > &index, oomph::DoubleMultiVector &mv)
 Copy the vectors in A to a set of vectors in mv indicated by the indices given in index.
 
static void SetBlock (const oomph::DoubleMultiVector &A, const Teuchos::Range1D &index, oomph::DoubleMultiVector &mv)
 Deep copy of A into specified columns of mv.
 
static void Assign (const oomph::DoubleMultiVector &A, oomph::DoubleMultiVector &mv)
 mv := A
 
static void MvRandom (oomph::DoubleMultiVector &mv)
 Replace the vectors in mv with random vectors.
 
static void MvInit (oomph::DoubleMultiVector &mv, const double alpha=Teuchos::ScalarTraits< double >::zero())
 Replace each element of the vectors in mv with alpha.
 

Print method

typedef Anasazi::details::StubTsqrAdapter< MV > tsqr_adaptor_type
 TsqrAdaptor specialization for the multivector type MV.
 
static void MvPrint (const oomph::DoubleMultiVector &mv, std::ostream &os)
 Print the mv multi-vector to the os output stream.
 

Detailed Description

Specialize the Anasazi traits class for the oomph-lib DoubleMultiVector. This provides the interfaces required by the Anasazi eigensolvers.

Definition at line 51 of file trilinos_eigen_solver.h.

Member Typedef Documentation

◆ tsqr_adaptor_type

Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::tsqr_adaptor_type

TsqrAdaptor specialization for the multivector type MV.

By default, we provide a "stub" implementation. It has the right methods and typedefs, but its constructors and methods all throw std::logic_error. If you plan to use TSQR in Anasazi (e.g., through TsqrOrthoManager), and if your multivector type MV is neither Epetra_MultiVector nor Tpetra::MultiVector, you must implement a functional TSQR adapter. Please refer to Epetra::TsqrAdapter (for Epetra_MultiVector) or Tpetra::TsqrAdaptor (for Tpetra::MultiVector) for examples.

Definition at line 453 of file trilinos_eigen_solver.h.

Member Function Documentation

◆ Assign()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::Assign ( const oomph::DoubleMultiVector A,
oomph::DoubleMultiVector mv 
)
inlinestatic

mv := A

Assign (deep copy) A into mv.

Definition at line 396 of file trilinos_eigen_solver.h.

◆ Clone()

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::Clone ( const oomph::DoubleMultiVector mv,
const int  numvecs 
)
inlinestatic

Creates a new empty DoubleMultiVector containing numvecs columns. Return a reference-counted pointer to the new multivector.

Definition at line 56 of file trilinos_eigen_solver.h.

◆ CloneCopy() [1/3]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneCopy ( const oomph::DoubleMultiVector mv)
inlinestatic

Creates a deep copy of the DoubleMultiVector mv return Reference-counted pointer to the new DoubleMultiVector.

Definition at line 64 of file trilinos_eigen_solver.h.

◆ CloneCopy() [2/3]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneCopy ( const oomph::DoubleMultiVector mv,
const std::vector< int > &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector and (deep) copies the contents of the vectors in index into the new vector return Reference-counted pointer to the new oomph::DoubleMultiVector.

Definition at line 74 of file trilinos_eigen_solver.h.

◆ CloneCopy() [3/3]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneCopy ( const oomph::DoubleMultiVector mv,
const Teuchos::Range1D &  index 
)
inlinestatic

Deep copy of specified columns of oomph::DoubleMultiVector return Reference-counted pointer to the new oomph::DoubleMultiVector.

Definition at line 82 of file trilinos_eigen_solver.h.

◆ CloneView() [1/3]

static Teuchos::RCP< const oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneView ( const oomph::DoubleMultiVector mv,
const std::vector< int > &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (const version)

Definition at line 113 of file trilinos_eigen_solver.h.

◆ CloneView() [2/3]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneView ( oomph::DoubleMultiVector mv,
const std::vector< int > &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (Non-const version for Trilinos 9 interface) NOTE: Not required in Trilinos 13.4.0.

Definition at line 125 of file trilinos_eigen_solver.h.

◆ CloneView() [3/3]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneView ( oomph::DoubleMultiVector mv,
const Teuchos::Range1D &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector (const version)

Definition at line 136 of file trilinos_eigen_solver.h.

◆ CloneViewNonConst() [1/2]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneViewNonConst ( oomph::DoubleMultiVector mv,
const std::vector< int > &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector.

Definition at line 92 of file trilinos_eigen_solver.h.

◆ CloneViewNonConst() [2/2]

static Teuchos::RCP< oomph::DoubleMultiVector > Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::CloneViewNonConst ( oomph::DoubleMultiVector mv,
const Teuchos::Range1D &  index 
)
inlinestatic

Creates a new oomph::DoubleMultiVector that contains shallow copies of selected entries of the oomph::DoubleMultiVector mv return Reference-counted pointer to the new oomph::DoubleMultiVector.

Definition at line 102 of file trilinos_eigen_solver.h.

◆ GetGlobalLength()

static ptrdiff_t Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::GetGlobalLength ( const oomph::DoubleMultiVector mv)
inlinestatic

Return the number of rows in the given multivector. NOTE: Trilinos 13.4.0 uses GetGlobalLength instead of GetVecLength.

Definition at line 150 of file trilinos_eigen_solver.h.

References oomph::DistributableLinearAlgebraObject::nrow().

◆ GetNumberVecs()

static int Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::GetNumberVecs ( const oomph::DoubleMultiVector mv)
inlinestatic

Obtain the number of vectors in the multivector.

Definition at line 156 of file trilinos_eigen_solver.h.

References oomph::DoubleMultiVector::nvector().

◆ GetVecLength()

static int Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::GetVecLength ( const oomph::DoubleMultiVector mv)
inlinestatic

Obtain the global length of the vector.

Definition at line 143 of file trilinos_eigen_solver.h.

References oomph::DistributableLinearAlgebraObject::nrow().

◆ MvAddMv()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvAddMv ( const double  alpha,
const oomph::DoubleMultiVector A,
const double  beta,
const oomph::DoubleMultiVector B,
oomph::DoubleMultiVector mv 
)
inlinestatic

◆ MvDot()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvDot ( const oomph::DoubleMultiVector mv,
const oomph::DoubleMultiVector A,
std::vector< double > &  b 
)
inlinestatic

Compute a vector b where the components are the individual dot-products of the i-th columns of A and mv, i.e. $ b[i] = * A[i]^Hmv[i] $.

Definition at line 310 of file trilinos_eigen_solver.h.

References oomph::DoubleMultiVector::dot().

◆ MvInit()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvInit ( oomph::DoubleMultiVector mv,
const double  alpha = Teuchos::ScalarTraits<double>::zero() 
)
inlinestatic

Replace each element of the vectors in mv with alpha.

Definition at line 419 of file trilinos_eigen_solver.h.

References oomph::DoubleMultiVector::initialise().

◆ MvNorm()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvNorm ( const oomph::DoubleMultiVector mv,
std::vector< double > &  normvec 
)
inlinestatic

Compute the 2-norm of each individual vector of mv. Upon return, normvec[i] holds the value of $||mv_i||_2$, the i-th column of mv.

Definition at line 322 of file trilinos_eigen_solver.h.

References oomph::DoubleMultiVector::norm().

◆ MvPrint()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvPrint ( const oomph::DoubleMultiVector mv,
std::ostream &  os 
)
inlinestatic

Print the mv multi-vector to the os output stream.

Definition at line 433 of file trilinos_eigen_solver.h.

References oomph::DoubleMultiVector::output().

◆ MvRandom()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvRandom ( oomph::DoubleMultiVector mv)
inlinestatic

Replace the vectors in mv with random vectors.

Definition at line 404 of file trilinos_eigen_solver.h.

References i, oomph::DistributableLinearAlgebraObject::nrow_local(), and oomph::DoubleMultiVector::nvector().

◆ MvScale() [1/2]

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvScale ( oomph::DoubleMultiVector mv,
const double  alpha 
)
inlinestatic

Scale each element of the vectors in mv with alpha.

Definition at line 216 of file trilinos_eigen_solver.h.

◆ MvScale() [2/2]

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvScale ( oomph::DoubleMultiVector mv,
const std::vector< double > &  alpha 
)
inlinestatic

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

Definition at line 224 of file trilinos_eigen_solver.h.

References i, oomph::DistributableLinearAlgebraObject::nrow_local(), and oomph::DoubleMultiVector::nvector().

◆ MvTimesMatAddMv()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvTimesMatAddMv ( const double  alpha,
const oomph::DoubleMultiVector A,
const Teuchos::SerialDenseMatrix< int, double > &  B,
const double  beta,
oomph::DoubleMultiVector mv 
)
inlinestatic

◆ MvTransMv()

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::MvTransMv ( const double  alpha,
const oomph::DoubleMultiVector A,
const oomph::DoubleMultiVector mv,
Teuchos::SerialDenseMatrix< int, double > &  B 
)
inlinestatic

◆ SetBlock() [1/2]

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::SetBlock ( const oomph::DoubleMultiVector A,
const std::vector< int > &  index,
oomph::DoubleMultiVector mv 
)
inlinestatic

Copy the vectors in A to a set of vectors in mv indicated by the indices given in index.

The numvecs vectors in A are copied to a subset of vectors in mv indicated by the indices given in index, i.e. mv[index[i]] = A[i].

Definition at line 339 of file trilinos_eigen_solver.h.

References i, and oomph::DistributableLinearAlgebraObject::nrow_local().

◆ SetBlock() [2/2]

static void Anasazi::MultiVecTraits< double, oomph::DoubleMultiVector >::SetBlock ( const oomph::DoubleMultiVector A,
const Teuchos::Range1D &  index,
oomph::DoubleMultiVector mv 
)
inlinestatic

Deep copy of A into specified columns of mv.

(Deeply) copy the first index.size() columns of A into the columns of mv specified by the given index range.

Postcondition: mv[i] = A[i - index.lbound()] for all i in [index.lbound(), index.ubound()]

Parameters
A[in] Source multivector
index[in] Inclusive index range of columns of mv; index set of the target
mv[out] Target multivector

Definition at line 371 of file trilinos_eigen_solver.h.

References i, and oomph::DistributableLinearAlgebraObject::nrow_local().


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