9#include "AnasaziOperator.hpp"
10#include <AnasaziMultiVec.hpp>
12#include <Teuchos_SerialDenseMatrix.hpp>
16template <
class ScalarT>
17class AnasaziOp :
public Anasazi::Operator<ScalarT> {
37 virtual void Apply (
const Anasazi::MultiVec<ScalarT>& x, Anasazi::MultiVec<ScalarT>& y )
const;
46 Teuchos::RCP<Operator<ScalarT> > op;
50template <
class ScalarT>
51class AnasaziMV :
public Anasazi::MultiVec<ScalarT> {
53 static const bool NO_ALLOCATE =
false;
56 AnasaziMV(
int dim = 0,
int nvecs = 0,
bool allocate =
true);
109 const Teuchos::SerialDenseMatrix<int,ScalarT>&
B,
ScalarT beta );
114 ScalarT beta,
const Anasazi::MultiVec<ScalarT>&
B );
120 Teuchos::SerialDenseMatrix<int,ScalarT>&
B
129 virtual void MvDot (
const Anasazi::MultiVec<ScalarT>& A, std::vector<ScalarT> & b
143 std::vector<
typename Teuchos::ScalarTraits<ScalarT>::magnitudeType> &
normvec
155 virtual void SetBlock (
const Anasazi::MultiVec<ScalarT>& A,
const std::vector<int>& index );
163 virtual void MvScale (
const std::vector<ScalarT>& alpha );
186 const VectorT* getVec(
int i)
const
virtual void MvScale(const std::vector< ScalarT > &alpha)
Scale each element of the i-th vector in *this with alpha[i].
virtual int GetNumberVecs() const
Obtain the number of vectors in *this.
virtual void MvDot(const Anasazi::MultiVec< ScalarT > &A, std::vector< ScalarT > &b) const
Compute a vector b where the components are the individual dot-products, i.e.b[i] = A[i]^H*this[i] wh...
virtual AnasaziMV< ScalarT > * CloneCopy() const
Creates a new Anasazi::MultiVec and copies contents of *this into the new vector (deep copy).
virtual AnasaziMV< ScalarT > * CloneCopy(const std::vector< int > &index) const
Creates a new Anasazi::MultiVec and copies the selected contents of *this into the new vector (deep c...
virtual void MvTransMv(ScalarT alpha, const Anasazi::MultiVec< ScalarT > &A, Teuchos::SerialDenseMatrix< int, ScalarT > &B) const
Compute a dense matrix B through the matrix-matrix multiply alpha * A^T * (*this).
int GetVecLength() const
Obtain the vector length of *this.
virtual void MvInit(ScalarT alpha)
Replace each element of the vectors in *this with alpha.
virtual AnasaziMV< ScalarT > * CloneView(const std::vector< int > &index)
Creates a new Anasazi::MultiVec that shares the selected contents of *this. The index of the numvecs ...
virtual void MvAddMv(ScalarT alpha, const Anasazi::MultiVec< ScalarT > &A, ScalarT beta, const Anasazi::MultiVec< ScalarT > &B)
Replace *this with alpha * A + beta * B.
virtual void MvTimesMatAddMv(ScalarT alpha, const Anasazi::MultiVec< ScalarT > &A, const Teuchos::SerialDenseMatrix< int, ScalarT > &B, ScalarT beta)
Update *this with alpha * A * B + beta * (*this).
virtual void SetBlock(const Anasazi::MultiVec< ScalarT > &A, const std::vector< int > &index)
Copy the vectors in A to a set of vectors in *this. The numvecs vectors in A are copied to a subset o...
virtual void MvRandom()
Fill the vectors in *this with random numbers.
virtual void MvScale(ScalarT alpha)
Scale each element of the vectors in *this with alpha.
virtual void MvPrint(std::ostream &os) const
Print *this multivector to the os output stream.
virtual void MvNorm(std::vector< typename Teuchos::ScalarTraits< ScalarT >::magnitudeType > &normvec) const
Compute the 2-norm of each individual vector of *this. Upon return, normvec[i] holds the 2-norm of ...
virtual AnasaziMV< ScalarT > * Clone(const int numvecs) const
Creates a new empty Anasazi::MultiVec containing numvecs columns.
virtual void Apply(const Anasazi::MultiVec< ScalarT > &x, Anasazi::MultiVec< ScalarT > &y) const
This method takes the Anasazi::MultiVec x and applies the operator to it resulting in the Anasazi::Mu...
virtual ~AnasaziOp()
Destructor.
AnasaziOp(Teuchos::RCP< Operator< ScalarT > > op)
Set< F > makeSet(uint n, const F &first,...)