10#ifndef ANASAZI_MULTI_VEC_TRAITS_HPP
11#define ANASAZI_MULTI_VEC_TRAITS_HPP
26#include "Teuchos_Range1D.hpp"
27#include "Teuchos_RCP.hpp"
28#include "Teuchos_SerialDenseMatrix.hpp"
38 template<
class ScalarType,
class MV >
47 static inline ScalarType
notDefined() {
return MV::this_type_is_missing_a_specialization(); };
94 template<
class ScalarType,
class MV>
104 static Teuchos::RCP<MV>
Clone(
const MV& mv,
const int numvecs )
119 static Teuchos::RCP<MV>
CloneCopy(
const MV& mv,
const std::vector<int>& index )
131 static Teuchos::RCP<MV>
CloneCopy(
const MV& mv,
const Teuchos::Range1D& index )
158 static Teuchos::RCP<const MV>
CloneView(
const MV& mv,
const std::vector<int>& index )
169 static Teuchos::RCP<const MV>
CloneView(
const MV& mv,
const Teuchos::Range1D& index )
193 const Teuchos::SerialDenseMatrix<int,ScalarType>& B,
194 const ScalarType beta, MV& mv )
199 static void MvAddMv(
const ScalarType alpha,
const MV& A,
const ScalarType beta,
const MV& B, MV& mv )
204 static void MvScale ( MV& mv,
const ScalarType alpha )
209 static void MvScale ( MV& mv,
const std::vector<ScalarType>& alpha )
216 MvTransMv (
const ScalarType alpha,
const MV& A,
const MV& B,
217 Teuchos::SerialDenseMatrix<int,ScalarType>& C)
222 static void MvDot (
const MV& mv,
const MV& A, std::vector<ScalarType> &b)
232 static void MvNorm(
const MV& mv, std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &normvec )
244 static void SetBlock(
const MV& A,
const std::vector<int>& index, MV& mv )
259 static void SetBlock(
const MV& A,
const Teuchos::Range1D& index, MV& mv )
265 static void Assign(
const MV& A, MV& mv )
275 static void MvInit( MV& mv,
const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
285 static void MvPrint(
const MV& mv, std::ostream& os )
290#ifdef HAVE_ANASAZI_TSQR
"Stub" TSQR adapter for unsupported multivector types.
Types and exceptions used within Anasazi solvers and interfaces.
Traits class which defines basic operations on multivectors.
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
static void MvAddMv(const ScalarType alpha, const MV &A, const ScalarType beta, const MV &B, MV &mv)
Replace mv with .
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
static void MvPrint(const MV &mv, std::ostream &os)
Print the mv multi-vector to the os output stream.
static void MvDot(const MV &mv, const MV &A, std::vector< ScalarType > &b)
Compute a vector b where the components are the individual dot-products of the i-th columns of A and ...
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
static Teuchos::RCP< MV > CloneCopy(const MV &mv, const std::vector< int > &index)
Creates a new MV and copies the selected contents of mv into the new vector (deep copy).
static void MvScale(MV &mv, const std::vector< ScalarType > &alpha)
Scale each element of the i-th vector in mv with alpha[i].
static void MvInit(MV &mv, const ScalarType alpha=Teuchos::ScalarTraits< ScalarType >::zero())
Replace each element of the vectors in mv with alpha.
static void MvScale(MV &mv, const ScalarType alpha)
Scale each element of the vectors in mv with alpha.
static Teuchos::RCP< const MV > CloneView(const MV &mv, const std::vector< int > &index)
Creates a new const MV that shares the selected contents of mv (shallow copy).
static void SetBlock(const MV &A, const Teuchos::Range1D &index, MV &mv)
Deep copy of A into specified columns of mv.
static Teuchos::RCP< MV > CloneCopy(const MV &mv, const Teuchos::Range1D &index)
Deep copy of specified columns of mv.
static void Assign(const MV &A, MV &mv)
mv := A
static ptrdiff_t GetGlobalLength(const MV &mv)
Return the number of rows in the given multivector mv.
static void MvTransMv(const ScalarType alpha, const MV &A, const MV &B, Teuchos::SerialDenseMatrix< int, ScalarType > &C)
Compute C := alpha * A^H B.
static Teuchos::RCP< const MV > CloneView(const MV &mv, const Teuchos::Range1D &index)
Const view of specified columns of mv.
static void MvRandom(MV &mv)
Replace the vectors in mv with random vectors.
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const Teuchos::Range1D &index)
Non-const view of specified columns of mv.
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta, MV &mv)
Update mv with .
static void MvNorm(const MV &mv, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec)
Compute the 2-norm of each individual vector of mv. Upon return, normvec[i] holds the value of ,...
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
Creates a new MV that shares the selected contents of mv (shallow copy).
static void SetBlock(const MV &A, const std::vector< int > &index, MV &mv)
Copy the vectors in A to a set of vectors in mv indicated by the indices given in index.
"Stub" TSQR adaptor for unsupported multivector types.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
Used by MultiVecTraits to report lack of a specialization.
static ScalarType notDefined()
Any attempt to compile this method will result in a compile-time error.