10#ifndef ANASAZI_BASIC_EIGENPROBLEM_H
11#define ANASAZI_BASIC_EIGENPROBLEM_H
28 template<
class ScalarType,
class MV,
class OP>
40 BasicEigenproblem(
const Teuchos::RCP<const OP>& Op,
const Teuchos::RCP<MV>& InitVec );
43 BasicEigenproblem(
const Teuchos::RCP<const OP>& Op,
const Teuchos::RCP<const OP>& B,
const Teuchos::RCP<MV>& InitVec );
134 Teuchos::RCP<const OP>
getA()
const {
return(
_AOp ); };
137 Teuchos::RCP<const OP>
getM()
const {
return(
_MOp ); };
189 Teuchos::RCP<const OP>
_Op;
225 template <
class ScalarType,
class MV,
class OP>
235 template <
class ScalarType,
class MV,
class OP>
247 template <
class ScalarType,
class MV,
class OP>
249 const Teuchos::RCP<MV>& InitVec ) :
261 template <
class ScalarType,
class MV,
class OP>
279 template <
class ScalarType,
class MV,
class OP>
286 if ( !
_AOp.get() && !
_Op.get() ) {
return false; }
289 if ( !
_InitVec.get() ) {
return false; }
292 if (
_nev == 0) {
return false; }
309 template <
class ScalarType,
class MV,
class OP>
314 TEUCHOS_TEST_FOR_EXCEPTION(!
isHermitian(), std::invalid_argument,
315 "BasicEigenproblem::computeCurrResVec: This method is not currently "
316 "implemented for non-Hermitian problems. Sorry for any inconvenience.");
321 return Teuchos::null;
324 RCP<MV> X = sol.
Evecs;
325 std::vector<ScalarType> Lambda(sol.
numVecs);
326 for(
int i = 0; i < sol.
numVecs; i++)
327 Lambda[i] = sol.
Evals[i].realpart;
331 if(
_AOp != Teuchos::null)
338 if(
_MOp != Teuchos::null)
Abstract base class which defines the interface required by an eigensolver and status test class to c...
Declaration of basic traits for the multivector type.
Virtual base class which defines basic traits for the operator type.
bool _isSet
Sanity Check Flag.
void setInitVec(const Teuchos::RCP< MV > &InitVec)
Set the initial guess.
Teuchos::RCP< const OP > getPrec() const
Get a pointer to the preconditioner of the eigenproblem .
Teuchos::RCP< const OP > _Prec
Reference-counted pointer for the preconditioner of the eigenproblem .
void setNEV(int nev)
Specify the number of eigenvalues (NEV) that are requested.
Teuchos::RCP< const MV > getInitVec() const
Get a pointer to the initial vector.
void setPrec(const Teuchos::RCP< const OP > &Prec)
Set the preconditioner for this eigenvalue problem .
void setHermitian(bool isSym)
Specify the symmetry of this eigenproblem.
void setA(const Teuchos::RCP< const OP > &A)
Set the operator A of the eigenvalue problem .
Eigensolution< ScalarType, MV > _sol
Solution to problem.
bool setProblem()
Specify that this eigenproblem is fully defined.
void setOperator(const Teuchos::RCP< const OP > &Op)
Set the operator for which eigenvalues will be computed.
Teuchos::RCP< const MV > _AuxVecs
Reference-counted pointer for the auxiliary vector of the eigenproblem .
Teuchos::RCP< const OP > getOperator() const
Get a pointer to the operator for which eigenvalues will be computed.
Teuchos::RCP< const OP > getM() const
Get a pointer to the operator M of the eigenproblem .
MultiVecTraits< ScalarType, MV > MVT
Type-definition for the MultiVecTraits class corresponding to the MV type.
Teuchos::RCP< const OP > getA() const
Get a pointer to the operator A of the eigenproblem .
Teuchos::RCP< const OP > _MOp
Reference-counted pointer for M of the eigenproblem .
Teuchos::RCP< const MV > getAuxVecs() const
Get a pointer to the auxiliary vector.
int _nev
Number of eigenvalues requested.
void setM(const Teuchos::RCP< const OP > &M)
Set the operator M of the eigenvalue problem .
void setSolution(const Eigensolution< ScalarType, MV > &sol)
Set the solution to the eigenproblem.
Teuchos::RCP< const MV > computeCurrResVec() const
Returns the residual vector corresponding to the computed solution.
Teuchos::RCP< MV > _InitVec
Reference-counted pointer for the initial vector of the eigenproblem .
Teuchos::RCP< const OP > _AOp
Reference-counted pointer for A of the eigenproblem .
bool isHermitian() const
Get the symmetry information for this eigenproblem.
const Eigensolution< ScalarType, MV > & getSolution() const
Get the solution to the eigenproblem.
bool _isSym
Symmetry of the eigenvalue problem.
bool isProblemSet() const
If the problem has been set, this method will return true.
OperatorTraits< ScalarType, MV, OP > OPT
Type-definition for the OperatorTraits class corresponding to the OP type.
void setAuxVecs(const Teuchos::RCP< const MV > &AuxVecs)
Set auxiliary vectors.
virtual ~BasicEigenproblem()
Destructor.
Teuchos::RCP< const OP > _Op
Reference-counted pointer for the operator of the eigenproblem .
BasicEigenproblem()
Empty constructor - allows Anasazi::BasicEigenproblem to be described at a later time through "Set Me...
int getNEV() const
Get the number of eigenvalues (NEV) that are required by this eigenproblem.
Eigenproblem()
Empty constructor.
Traits class which defines basic operations on multivectors.
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 Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
static void MvScale(MV &mv, const ScalarType alpha)
Scale each element of the vectors in mv with alpha.
Virtual base class which defines basic traits for the operator type.
static void Apply(const OP &Op, const MV &x, MV &y)
Application method which performs operation y = Op*x. An OperatorError exception is thrown if there i...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
Struct for storing an eigenproblem solution.
Teuchos::RCP< MV > Evecs
The computed eigenvectors.
int numVecs
The number of computed eigenpairs.
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.