Anasazi::BlockKrylovSchur< ScalarType, MV, OP > Class Template Reference
[Anasazi Eigensolver Framework]

This class implements the block Krylov-Schur iteration, for solving linear eigenvalue problems. More...

#include <AnasaziBlockKrylovSchur.hpp>

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

Anasazi::Eigensolver< ScalarType, MV, OP > List of all members.

Public Member Functions

Constructor/Destructor
 BlockKrylovSchur (const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< SortManager< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > > &sorter, const Teuchos::RCP< OutputManager< ScalarType > > &printer, const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &tester, const Teuchos::RCP< OrthoManager< ScalarType, MV > > &ortho, Teuchos::ParameterList &params)
 BlockKrylovSchur constructor with eigenproblem, solver utilities, and parameter list of solver options.
virtual ~BlockKrylovSchur ()
 BlockKrylovSchur destructor.
Solver methods
void iterate ()
 This method performs Block Krylov-Schur iterations until the status test indicates the need to stop or an error occurs (in which case, an exception is thrown).
void initialize (BlockKrylovSchurState< ScalarType, MV > state)
 Initialize the solver to an iterate, providing a Krylov basis and Hessenberg matrix.
void initialize ()
 Initialize the solver with the initial vectors from the eigenproblem or random data.
bool isInitialized () const
 Indicates whether the solver has been initialized or not.
BlockKrylovSchurState< ScalarType,
MV > 
getState () const
 Get the current state of the eigensolver.
Status methods
int getNumIters () const
 Get the current iteration count.
void resetNumIters ()
 Reset the iteration count.
Teuchos::RCP< const MV > getRitzVectors ()
 Get the Ritz vectors.
std::vector< Value< ScalarType > > getRitzValues ()
 Get the Ritz values.
std::vector< int > getRitzIndex ()
 Get the Ritz index vector.
std::vector< typename Teuchos::ScalarTraits<
ScalarType >::magnitudeType > 
getResNorms ()
 Get the current residual norms.
std::vector< typename Teuchos::ScalarTraits<
ScalarType >::magnitudeType > 
getRes2Norms ()
 Get the current residual 2-norms.
std::vector< typename Teuchos::ScalarTraits<
ScalarType >::magnitudeType > 
getRitzRes2Norms ()
 Get the current Ritz residual 2-norms.
Accessor routines
void setStatusTest (Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
 Set a new StatusTest for the solver.
Teuchos::RCP< StatusTest<
ScalarType, MV, OP > > 
getStatusTest () const
 Get the current StatusTest used by the solver.
const Eigenproblem< ScalarType,
MV, OP > & 
getProblem () const
 Get a constant reference to the eigenvalue problem.
void setSize (int blockSize, int numBlocks)
 Set the blocksize and number of blocks to be used by the iterative solver in solving this eigenproblem.
void setBlockSize (int blockSize)
 Set the blocksize.
void setStepSize (int stepSize)
 Set the step size.
void setNumRitzVectors (int numRitzVecs)
 Set the number of Ritz vectors to compute.
int getStepSize () const
 Get the step size.
int getBlockSize () const
 Get the blocksize to be used by the iterative solver in solving this eigenproblem.
int getNumRitzVectors () const
 Get the number of Ritz vectors to compute.
int getCurSubspaceDim () const
 Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues.
int getMaxSubspaceDim () const
 Get the maximum dimension allocated for the search subspace.
void setAuxVecs (const Teuchos::Array< Teuchos::RCP< const MV > > &auxvecs)
 Set the auxiliary vectors for the solver.
Teuchos::Array< Teuchos::RCP<
const MV > > 
getAuxVecs () const
 Get the auxiliary vectors for the solver.
Output methods
void currentStatus (std::ostream &os)
 This method requests that the solver print out its current status to screen.
Block-Krylov Schur status routines
bool isRitzVecsCurrent () const
 Get the status of the Ritz vectors currently stored in the eigensolver.
bool isRitzValsCurrent () const
 Get the status of the Ritz values currently stored in the eigensolver.
bool isSchurCurrent () const
 Get the status of the Schur form currently stored in the eigensolver.
Block-Krylov Schur compute routines
void computeRitzVectors ()
 Compute the Ritz vectors using the current Krylov factorization.
void computeRitzValues ()
 Compute the Ritz values using the current Krylov factorization.
void computeSchurForm (const bool sort=true)
 Compute the Schur form of the projected eigenproblem from the current Krylov factorization.

Detailed Description

template<class ScalarType, class MV, class OP>
class Anasazi::BlockKrylovSchur< ScalarType, MV, OP >

This class implements the block Krylov-Schur iteration, for solving linear eigenvalue problems.

This method is a block version of the iteration presented by G.W. Stewart in "A Krylov-Schur Algorithm for Large Eigenproblems", SIAM J. Matrix Anal. Appl., Vol 23(2001), No. 3, pp. 601-614.

Author:
Chris Baker, Ulrich Hetmaniuk, Rich Lehoucq, Heidi Thornquist

Definition at line 134 of file AnasaziBlockKrylovSchur.hpp.


Constructor & Destructor Documentation

template<class ScalarType, class MV, class OP>
Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::BlockKrylovSchur ( const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &  problem,
const Teuchos::RCP< SortManager< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > > &  sorter,
const Teuchos::RCP< OutputManager< ScalarType > > &  printer,
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &  tester,
const Teuchos::RCP< OrthoManager< ScalarType, MV > > &  ortho,
Teuchos::ParameterList params 
)

BlockKrylovSchur constructor with eigenproblem, solver utilities, and parameter list of solver options.

This constructor takes pointers required by the eigensolver, in addition to a parameter list of options for the eigensolver. These options include the following:

Definition at line 544 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
virtual Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::~BlockKrylovSchur (  )  [inline, virtual]

BlockKrylovSchur destructor.

Definition at line 159 of file AnasaziBlockKrylovSchur.hpp.


Member Function Documentation

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::iterate (  )  [virtual]

This method performs Block Krylov-Schur iterations until the status test indicates the need to stop or an error occurs (in which case, an exception is thrown).

iterate() will first determine whether the solver is inintialized; if not, it will call initialize() using default arguments. After initialization, the solver performs Block Krylov-Schur iterations until the status test evaluates as Passed, at which point the method returns to the caller.

The Block Krylov-Schur iteration proceeds as follows:

  1. The operator problem->getOperator() is applied to the newest blockSize vectors in the Krylov basis.
  2. The resulting vectors are orthogonalized against the auxiliary vectors and the previous basis vectors, and made orthonormal.
  3. The Hessenberg matrix is updated.
  4. If we have performed stepSize iterations since the last update, update the Ritz values and Ritz residuals.

The status test is queried at the beginning of the iteration.

Possible exceptions thrown include the BlockKrylovSchurOrthoFailure.

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

Definition at line 947 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::initialize ( BlockKrylovSchurState< ScalarType, MV >  state  ) 

Initialize the solver to an iterate, providing a Krylov basis and Hessenberg matrix.

The BlockKrylovSchur eigensolver contains a certain amount of state, consisting of the current Krylov basis and the associated Hessenberg matrix.

initialize() gives the user the opportunity to manually set these, although this must be done with caution, abiding by the rules given below. All notions of orthogonality and orthonormality are derived from the inner product specified by the orthogonalization manager.

Postcondition:
isInitialized() == true (see post-conditions of isInitialize())
The user has the option of specifying any component of the state using initialize(). However, these arguments are assumed to match the post-conditions specified under isInitialized(). Any necessary component of the state not given to initialize() will be generated.

Note, for any pointer in newstate which directly points to the multivectors in the solver, the data is not copied.

Definition at line 770 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::initialize (  )  [virtual]

Initialize the solver with the initial vectors from the eigenproblem or random data.

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

Definition at line 937 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
bool Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::isInitialized (  )  const [inline, virtual]

Indicates whether the solver has been initialized or not.

Returns:
bool indicating the state of the solver.
Postcondition:
If isInitialized() == true:
  • the first getCurSubspaceDim() vectors of V are orthogonal to auxiliary vectors and have orthonormal columns
  • the principal Hessenberg submatrix of of H contains the Hessenberg matrix associated with V

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

Definition at line 225 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
BlockKrylovSchurState<ScalarType,MV> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getState (  )  const [inline]

Get the current state of the eigensolver.

The data is only valid if isInitialized() == true.

Returns:
A BlockKrylovSchurState object containing const pointers to the current solver state.

Definition at line 234 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getNumIters (  )  const [inline, virtual]

Get the current iteration count.

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

Definition at line 251 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::resetNumIters (  )  [inline, virtual]

Reset the iteration count.

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

Definition at line 254 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
Teuchos::RCP<const MV> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzVectors (  )  [inline, virtual]

Get the Ritz vectors.

Returns:
A multivector of columns not exceeding the maximum dimension of the subspace containing the Ritz vectors from the most recent call to computeRitzVectors().
Note:
To see if the returned Ritz vectors are current, call isRitzVecsCurrent().

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

Definition at line 263 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
std::vector<Value<ScalarType> > Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzValues (  )  [inline, virtual]

Get the Ritz values.

Returns:
A vector of length not exceeding the maximum dimension of the subspace containing the Ritz values from the most recent Schur form update.
Note:
To see if the returned Ritz values are current, call isRitzValsCurrent().

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

Definition at line 272 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
std::vector<int> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzIndex (  )  [inline, virtual]

Get the Ritz index vector.

Returns:
A vector of length not exceeding the maximum dimension of the subspace containing the index vector for the Ritz values and Ritz vectors, if they are computed.

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

Definition at line 283 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getResNorms (  )  [inline, virtual]

Get the current residual norms.

Note:
Block Krylov-Schur cannot provide this so a zero length vector will be returned.

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

Definition at line 289 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRes2Norms (  )  [inline, virtual]

Get the current residual 2-norms.

Note:
Block Krylov-Schur cannot provide this so a zero length vector will be returned.

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

Definition at line 298 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzRes2Norms (  )  [inline, virtual]

Get the current Ritz residual 2-norms.

Returns:
A vector of length blockSize containing the 2-norms of the Ritz residuals.

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

Definition at line 307 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setStatusTest ( Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test  )  [virtual]

Set a new StatusTest for the solver.

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

Definition at line 1355 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getStatusTest (  )  const [virtual]

Get the current StatusTest used by the solver.

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

Definition at line 1364 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
const Eigenproblem<ScalarType,MV,OP>& Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getProblem (  )  const [inline, virtual]

Get a constant reference to the eigenvalue problem.

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

Definition at line 325 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setSize ( int  blockSize,
int  numBlocks 
)

Set the blocksize and number of blocks to be used by the iterative solver in solving this eigenproblem.

Changing either the block size or the number of blocks will reset the solver to an uninitialized state.

Definition at line 676 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setBlockSize ( int  blockSize  )  [virtual]

Set the blocksize.

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

Definition at line 635 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setStepSize ( int  stepSize  ) 

Set the step size.

Definition at line 644 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setNumRitzVectors ( int  numRitzVecs  ) 

Set the number of Ritz vectors to compute.

Definition at line 653 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getStepSize (  )  const [inline]

Get the step size.

Definition at line 345 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getBlockSize (  )  const [inline, virtual]

Get the blocksize to be used by the iterative solver in solving this eigenproblem.

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

Definition at line 348 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getNumRitzVectors (  )  const [inline]

Get the number of Ritz vectors to compute.

Definition at line 351 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getCurSubspaceDim (  )  const [inline, virtual]

Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues.

Returns:
An integer specifying the rank of the Krylov subspace currently in use by the eigensolver. If isInitialized() == false, the return is 0.

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

Definition at line 358 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getMaxSubspaceDim (  )  const [inline, virtual]

Get the maximum dimension allocated for the search subspace.

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

Definition at line 364 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setAuxVecs ( const Teuchos::Array< Teuchos::RCP< const MV > > &  auxvecs  )  [virtual]

Set the auxiliary vectors for the solver.

Because the current Krylov subspace cannot be assumed orthogonal to the new auxiliary vectors, a call to setAuxVecs() will reset the solver to the uninitialized state. This happens only in the case where the new auxiliary vectors have a combined dimension of greater than zero.

In order to preserve the current state, the user will need to extract it from the solver using getState(), orthogonalize it against the new auxiliary vectors, and reinitialize using initialize().

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

Definition at line 736 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
Teuchos::Array<Teuchos::RCP<const MV> > Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getAuxVecs (  )  const [inline, virtual]

Get the auxiliary vectors for the solver.

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

Definition at line 382 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::currentStatus ( std::ostream &  os  )  [virtual]

This method requests that the solver print out its current status to screen.

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

Definition at line 1641 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
bool Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::isRitzVecsCurrent (  )  const [inline]

Get the status of the Ritz vectors currently stored in the eigensolver.

Definition at line 398 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
bool Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::isRitzValsCurrent (  )  const [inline]

Get the status of the Ritz values currently stored in the eigensolver.

Definition at line 401 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
bool Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::isSchurCurrent (  )  const [inline]

Get the status of the Schur form currently stored in the eigensolver.

Definition at line 404 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeRitzVectors (  ) 

Compute the Ritz vectors using the current Krylov factorization.

Definition at line 1220 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeRitzValues (  ) 

Compute the Ritz values using the current Krylov factorization.

Definition at line 1192 of file AnasaziBlockKrylovSchur.hpp.

template<class ScalarType, class MV, class OP>
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeSchurForm ( const bool  sort = true  ) 

Compute the Schur form of the projected eigenproblem from the current Krylov factorization.

Definition at line 1382 of file AnasaziBlockKrylovSchur.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Jul 13 09:22:48 2010 for Anasazi by  doxygen 1.4.7