27 #ifndef ANASAZI_MULTI_VEC_TRAITS_HPP
28 #define ANASAZI_MULTI_VEC_TRAITS_HPP
30 #include "AnasaziConfigDefs.hpp"
31 #include "AnasaziTypes.hpp"
32 #include "Teuchos_RCP.hpp"
33 #include "Teuchos_SerialDenseMatrix.hpp"
35 #include <boost/shared_ptr.hpp>
36 #include <boost/noncopyable.hpp>
43 template<
class Vector>
47 typedef typename std::vector<boost::shared_ptr<Vector> >
data_type;
53 template<
class ScalarType,
class MV >
54 struct UndefinedMultiVecTraits
59 template<
class ScalarType,
class Vector>
65 static Teuchos::RCP<MV>
Clone(
const MV& mv,
const int numvecs )
67 MV * ret =
new MV(numvecs);
68 for (
int k = 0; i < numvecs; ++k)
71 return Teuchos::RCP<MV>(ret);
77 for (
int k = 0; i < numvecs; ++k)
78 ret->
data[i].reset(
new Vector(mv.
data[k]) );
79 return Teuchos::RCP<MV>(ret);
82 static Teuchos::RCP<MV>
CloneCopy(
const MV& mv,
const std::vector<int>& index )
84 MV * ret =
new MV(index.size());
85 for (
int k = 0; k < index.size(); ++k)
86 ret->
data[k].reset(
new Vector(mv->
data[index[k]]) );
87 return Teuchos::RCP<MV>(ret);
92 MV * ret =
new MV(index.size());
93 for (
int k = 0; k < index.size(); ++k)
95 return Teuchos::RCP<MV>(ret);
98 static Teuchos::RCP<const MV>
CloneView(
const MV& mv,
const std::vector<int>& index )
100 MV * ret =
new MV(index.size());
101 for (
int k = 0; k < index.size(); ++k)
103 return Teuchos::RCP<MV>(ret);
113 return mv.
data.size();
118 const Teuchos::SerialDenseMatrix<int,ScalarType>& B,
128 static void MvScale (
MV& mv,
const std::vector<ScalarType>& alpha )
134 static void MvDot (
const MV& mv,
const MV& A, std::vector<ScalarType> &b)
140 static void MvNorm(
const MV& mv, std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &normvec )
146 static void SetBlock(
const MV& A,
const std::vector<int>& index,
MV& mv )
165 #endif // ANASAZI_MULTI_VEC_TRAITS_HPP
std::vector< boost::shared_ptr< Vector > > data_type
static Teuchos::RCP< MV > CloneCopy(const MV &mv, const std::vector< int > &index)
Anasazi::IETLMultMv boost::noncopyable notDefined()
class Anasazi::MultiVecTraits< double, IETLMultMv< Vector > > notDefined
static void MvTransMv(const ScalarType alpha, const MV &A, const MV &mv, Teuchos::SerialDenseMatrix< int, ScalarType > &B)
static Teuchos::RCP< const MV > CloneView(const MV &mv, const std::vector< int > &index)
static void MvNorm(const MV &mv, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec)
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
static void SetBlock(const MV &A, const std::vector< int > &index, MV &mv)
static void MvDot(const MV &mv, const MV &A, std::vector< ScalarType > &b)
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta, MV &mv)
static void MvPrint(const MV &mv, std::ostream &os)
static void MvScale(MV &mv, const ScalarType alpha)
static void MvAddMv(const ScalarType alpha, const MV &A, const ScalarType beta, const MV &B, MV &mv)
Anasazi::IETLMultMv ScalarType
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
static int GetNumberVecs(const MV &mv)
static void MvScale(MV &mv, const std::vector< ScalarType > &alpha)
IETLMultMv(std::size_t k=0)
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
static void MvInit(MV &mv, const ScalarType alpha=Teuchos::ScalarTraits< ScalarType >::zero())
static int GetVecLength(const MV &mv)
static void MvRandom(MV &mv)