Anasazi  Version of the Day
Anasazi::BasicEigenproblem< ScalarType, MV, OP > Class Template Reference

This provides a basic implementation for defining standard or generalized eigenvalue problems. More...

#include <AnasaziBasicEigenproblem.hpp>

Inheritance diagram for Anasazi::BasicEigenproblem< ScalarType, MV, OP >:

## Public Member Functions

Constructors/Destructor
BasicEigenproblem ()
Empty constructor - allows Anasazi::BasicEigenproblem to be described at a later time through "Set Methods". More...

BasicEigenproblem (const Teuchos::RCP< const OP > &Op, const Teuchos::RCP< MV > &InitVec)
Standard Eigenvalue Problem Constructor. More...

BasicEigenproblem (const Teuchos::RCP< const OP > &Op, const Teuchos::RCP< const OP > &B, const Teuchos::RCP< MV > &InitVec)
Generalized Eigenvalue Problem Constructor. More...

BasicEigenproblem (const BasicEigenproblem< ScalarType, MV, OP > &Problem)
Copy Constructor. More...

virtual ~BasicEigenproblem ()
Destructor. More...

Set Methods
void setOperator (const Teuchos::RCP< const OP > &Op)
Set the operator for which eigenvalues will be computed. More...

void setA (const Teuchos::RCP< const OP > &A)
Set the operator A of the eigenvalue problem . More...

void setM (const Teuchos::RCP< const OP > &M)
Set the operator M of the eigenvalue problem . More...

void setPrec (const Teuchos::RCP< const OP > &Prec)
Set the preconditioner for this eigenvalue problem . More...

void setInitVec (const Teuchos::RCP< MV > &InitVec)
Set the initial guess. More...

void setAuxVecs (const Teuchos::RCP< const MV > &AuxVecs)
Set auxiliary vectors. More...

void setNEV (int nev)
Specify the number of eigenvalues (NEV) that are requested. More...

void setHermitian (bool isSym)
Specify the symmetry of this eigenproblem. More...

bool setProblem ()
Specify that this eigenproblem is fully defined. More...

void setSolution (const Eigensolution< ScalarType, MV > &sol)
Set the solution to the eigenproblem. More...

Accessor Methods
Teuchos::RCP< const OP > getOperator () const
Get a pointer to the operator for which eigenvalues will be computed. More...

Teuchos::RCP< const OP > getA () const
Get a pointer to the operator A of the eigenproblem . More...

Teuchos::RCP< const OP > getM () const
Get a pointer to the operator M of the eigenproblem . More...

Teuchos::RCP< const OP > getPrec () const
Get a pointer to the preconditioner of the eigenproblem . More...

Teuchos::RCP< const MV > getInitVec () const
Get a pointer to the initial vector. More...

Teuchos::RCP< const MV > getAuxVecs () const
Get a pointer to the auxiliary vector. More...

int getNEV () const
Get the number of eigenvalues (NEV) that are required by this eigenproblem. More...

bool isHermitian () const
Get the symmetry information for this eigenproblem. More...

bool isProblemSet () const
If the problem has been set, this method will return true. More...

const Eigensolution
< ScalarType, MV > &
getSolution () const
Get the solution to the eigenproblem. More...

Apply / Compute Methods
Teuchos::RCP< const MV > computeCurrResVec () const
Returns the residual vector corresponding to the computed solution. More...

Public Member Functions inherited from Anasazi::Eigenproblem< ScalarType, MV, OP >
Eigenproblem ()
Empty constructor. More...

virtual ~Eigenproblem ()
Destructor. More...

## Protected Types

typedef MultiVecTraits
< ScalarType, MV >
MVT
Type-definition for the MultiVecTraits class corresponding to the MV type. More...

typedef OperatorTraits
< ScalarType, MV, OP >
OPT
Type-definition for the OperatorTraits class corresponding to the OP type. More...

## Protected Attributes

Teuchos::RCP< const OP > _AOp
Reference-counted pointer for A of the eigenproblem . More...

Teuchos::RCP< const OP > _MOp
Reference-counted pointer for M of the eigenproblem . More...

Teuchos::RCP< const OP > _Op
Reference-counted pointer for the operator of the eigenproblem . More...

Teuchos::RCP< const OP > _Prec
Reference-counted pointer for the preconditioner of the eigenproblem . More...

Teuchos::RCP< MV > _InitVec
Reference-counted pointer for the initial vector of the eigenproblem . More...

Teuchos::RCP< const MV > _AuxVecs
Reference-counted pointer for the auxiliary vector of the eigenproblem . More...

int _nev
Number of eigenvalues requested. More...

bool _isSym
Symmetry of the eigenvalue problem. More...

bool _isSet
Sanity Check Flag. More...

Eigensolution< ScalarType, MV > _sol
Solution to problem. More...

## Detailed Description

### template<class ScalarType, class MV, class OP> class Anasazi::BasicEigenproblem< ScalarType, MV, OP >

This provides a basic implementation for defining standard or generalized eigenvalue problems.

Examples:
BlockDavidson/BlockDavidsonEpetraEx.cpp, BlockDavidson/BlockDavidsonEpetraExGen.cpp, BlockDavidson/BlockDavidsonEpetraExGenPrecIfpack.cpp, BlockKrylovSchur/BlockKrylovSchurEpetraEx.cpp, BlockKrylovSchur/BlockKrylovSchurEpetraExGenAmesos.cpp, BlockKrylovSchur/BlockKrylovSchurEpetraExGenAztecOO.cpp, BlockKrylovSchur/BlockKrylovSchurEpetraExGenBelos.cpp, BlockKrylovSchur/BlockKrylovSchurEpetraExSVD.cpp, GeneralizedDavidson/GeneralizedDavidsonEpetraExFileIfpack.cpp, LOBPCGCustomStatusTest.cpp, LOBPCGEpetra.cpp, LOBPCGEpetraEx.cpp, LOBPCGEpetraExGen.cpp, LOBPCGEpetraExGenPrecIfpack.cpp, LOBPCGEpetraExGenShifted.cpp, LOBPCGEpetraExSimple.cpp, TraceMinDavidsonGeneralizedEx.cpp, TraceMinDavidsonLaplacianEx.cpp, TraceMinDavidsonSpecTransEx.cpp, and TraceMinDavidsonUserOpEx.cpp.

Definition at line 61 of file AnasaziBasicEigenproblem.hpp.

## Member Typedef Documentation

template<class ScalarType, class MV, class OP>
 typedef MultiVecTraits Anasazi::BasicEigenproblem< ScalarType, MV, OP >::MVT
protected

Type-definition for the MultiVecTraits class corresponding to the MV type.

Definition at line 245 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 typedef OperatorTraits Anasazi::BasicEigenproblem< ScalarType, MV, OP >::OPT
protected

Type-definition for the OperatorTraits class corresponding to the OP type.

Definition at line 247 of file AnasaziBasicEigenproblem.hpp.

## Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
 Anasazi::BasicEigenproblem< ScalarType, MV, OP >::BasicEigenproblem ( )

Empty constructor - allows Anasazi::BasicEigenproblem to be described at a later time through "Set Methods".

Definition at line 258 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType , class MV , class OP >
 Anasazi::BasicEigenproblem< ScalarType, MV, OP >::BasicEigenproblem ( const Teuchos::RCP< const OP > & Op, const Teuchos::RCP< MV > & InitVec )

Standard Eigenvalue Problem Constructor.

Definition at line 268 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType , class MV , class OP >
 Anasazi::BasicEigenproblem< ScalarType, MV, OP >::BasicEigenproblem ( const Teuchos::RCP< const OP > & Op, const Teuchos::RCP< const OP > & B, const Teuchos::RCP< MV > & InitVec )

Generalized Eigenvalue Problem Constructor.

Definition at line 280 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType , class MV , class OP >
 Anasazi::BasicEigenproblem< ScalarType, MV, OP >::BasicEigenproblem ( const BasicEigenproblem< ScalarType, MV, OP > & Problem )

Copy Constructor.

Definition at line 294 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 virtual Anasazi::BasicEigenproblem< ScalarType, MV, OP >::~BasicEigenproblem ( )
inlinevirtual

Destructor.

Definition at line 81 of file AnasaziBasicEigenproblem.hpp.

## Member Function Documentation

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setOperator ( const Teuchos::RCP< const OP > & Op )
inlinevirtual

Set the operator for which eigenvalues will be computed.

Note
This may be different from the A if a spectral transformation is employed. For example, this operator may apply the operation if you are looking for eigenvalues of A around .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 93 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setA ( const Teuchos::RCP< const OP > & A )
inlinevirtual

Set the operator A of the eigenvalue problem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 97 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setM ( const Teuchos::RCP< const OP > & M )
inlinevirtual

Set the operator M of the eigenvalue problem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 101 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setPrec ( const Teuchos::RCP< const OP > & Prec )
inlinevirtual

Set the preconditioner for this eigenvalue problem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 105 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setInitVec ( const Teuchos::RCP< MV > & InitVec )
inlinevirtual

Set the initial guess.

This vector is required to create all the space needed by Anasazi to solve the eigenvalue problem.

Note
Even if an initial guess is not known by the user, an initial vector must be passed in.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 114 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setAuxVecs ( const Teuchos::RCP< const MV > & AuxVecs )
inlinevirtual

Set auxiliary vectors.

Note
This multivector can have any number of columns, and most likely will contain vectors that will be used by the eigensolver to orthogonalize against.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 121 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setNEV ( int nev )
inlinevirtual

Specify the number of eigenvalues (NEV) that are requested.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 124 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setHermitian ( bool isSym )
inlinevirtual

Specify the symmetry of this eigenproblem.

This knowledge may allow the solver to take advantage of the eigenproblems' symmetry. Some computational work can be avoided by setting this properly.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 130 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType , class MV , class OP >
 bool Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setProblem ( )
virtual

Specify that this eigenproblem is fully defined.

This routine serves multiple purpose:

• sanity check that the eigenproblem has been fully and consistently defined
• opportunity for the eigenproblem to allocate internal storage for eigenvalues and eigenvectors (to be used by eigensolvers and solver managers)

This method reallocates internal storage, so that any previously retrieved references to internal storage (eigenvectors or eigenvalues) are invalidated.

Note
The user MUST call this routine before they send the eigenproblem to any solver or solver manager.
Returns
true signifies success, false signifies error.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 312 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 void Anasazi::BasicEigenproblem< ScalarType, MV, OP >::setSolution ( const Eigensolution< ScalarType, MV > & sol )
inlinevirtual

Set the solution to the eigenproblem.

This mechanism allows an Eigensolution struct to be associated with an Eigenproblem object. setSolution() is usually called by a solver manager at the end of its SolverManager::solve() routine.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 155 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getOperator ( ) const
inlinevirtual

Get a pointer to the operator for which eigenvalues will be computed.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 163 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getA ( ) const
inlinevirtual

Get a pointer to the operator A of the eigenproblem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 166 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getM ( ) const
inlinevirtual

Get a pointer to the operator M of the eigenproblem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 169 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getPrec ( ) const
inlinevirtual

Get a pointer to the preconditioner of the eigenproblem .

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 172 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getInitVec ( ) const
inlinevirtual

Get a pointer to the initial vector.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 175 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getAuxVecs ( ) const
inlinevirtual

Get a pointer to the auxiliary vector.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 178 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 int Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getNEV ( ) const
inlinevirtual

Get the number of eigenvalues (NEV) that are required by this eigenproblem.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 181 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 bool Anasazi::BasicEigenproblem< ScalarType, MV, OP >::isHermitian ( ) const
inlinevirtual

Get the symmetry information for this eigenproblem.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 184 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 bool Anasazi::BasicEigenproblem< ScalarType, MV, OP >::isProblemSet ( ) const
inlinevirtual

If the problem has been set, this method will return true.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 187 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 const Eigensolution& Anasazi::BasicEigenproblem< ScalarType, MV, OP >::getSolution ( ) const
inlinevirtual

Get the solution to the eigenproblem.

There is no computation associated with this method. It only provides a mechanism for associating an Eigensolution with a Eigenproblem.

Implements Anasazi::Eigenproblem< ScalarType, MV, OP >.

Definition at line 194 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType , class MV , class OP >
 Teuchos::RCP< const MV > Anasazi::BasicEigenproblem< ScalarType, MV, OP >::computeCurrResVec ( ) const

Returns the residual vector corresponding to the computed solution.

If there is no computed solution, returns Teuchos::null.

Note
If A has not been set, this function will compute If you are using a spectral transformation, this may not be what you want.

Definition at line 342 of file AnasaziBasicEigenproblem.hpp.

## Member Data Documentation

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_AOp
protected

Reference-counted pointer for A of the eigenproblem .

Definition at line 215 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_MOp
protected

Reference-counted pointer for M of the eigenproblem .

Definition at line 218 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_Op
protected

Reference-counted pointer for the operator of the eigenproblem .

Definition at line 221 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_Prec
protected

Reference-counted pointer for the preconditioner of the eigenproblem .

Definition at line 224 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_InitVec
protected

Reference-counted pointer for the initial vector of the eigenproblem .

Definition at line 227 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Teuchos::RCP Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_AuxVecs
protected

Reference-counted pointer for the auxiliary vector of the eigenproblem .

Definition at line 230 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 int Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_nev
protected

Number of eigenvalues requested.

Definition at line 233 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 bool Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_isSym
protected

Symmetry of the eigenvalue problem.

Note
A generalized eigenvalue problem is considered symmetric if the operator M is positive (semi) definite.

Definition at line 239 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 bool Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_isSet
protected

Sanity Check Flag.

Definition at line 242 of file AnasaziBasicEigenproblem.hpp.

template<class ScalarType, class MV, class OP>
 Eigensolution Anasazi::BasicEigenproblem< ScalarType, MV, OP >::_sol
protected

Solution to problem.

Definition at line 250 of file AnasaziBasicEigenproblem.hpp.

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