#include <AnasaziBlockKrylovSchur.hpp>
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 ¶ms) | |
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. |
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.
Definition at line 134 of file AnasaziBlockKrylovSchur.hpp.
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 | |||
) | [inline] |
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:
int
specifying the block size used by the algorithm. This can also be specified using the setBlockSize() method. Default: 1int
specifying the maximum number of blocks allocated for the solver basis. Default: 3*problem->getNEV()int
specifying how many iterations are performed between computations of eigenvalues and eigenvectors.int
specifying how many Ritz vectors are computed on calls to getRitzVectors(). Default: 0int
specifying how many Ritz values are printed on calls to currentStatus(). Default: "Block Size" Definition at line 544 of file AnasaziBlockKrylovSchur.hpp.
virtual Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::~BlockKrylovSchur | ( | ) | [inline, virtual] |
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeRitzValues | ( | ) | [inline] |
Compute the Ritz values using the current Krylov factorization.
Definition at line 1181 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeRitzVectors | ( | ) | [inline] |
Compute the Ritz vectors using the current Krylov factorization.
Definition at line 1209 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::computeSchurForm | ( | const bool | sort = true |
) | [inline] |
Compute the Schur form of the projected eigenproblem from the current Krylov factorization.
Definition at line 1371 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::currentStatus | ( | std::ostream & | os | ) | [inline, virtual] |
This method requests that the solver print out its current status to screen.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 1630 of file AnasaziBlockKrylovSchur.hpp.
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.
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.
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.
false
, the return is 0. Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 358 of file AnasaziBlockKrylovSchur.hpp.
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.
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.
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.
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.
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRes2Norms | ( | ) | [inline, virtual] |
Get the current residual 2-norms.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 298 of file AnasaziBlockKrylovSchur.hpp.
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getResNorms | ( | ) | [inline, virtual] |
Get the current residual norms.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 289 of file AnasaziBlockKrylovSchur.hpp.
std::vector<int> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzIndex | ( | ) | [inline, virtual] |
Get the Ritz index vector.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 283 of file AnasaziBlockKrylovSchur.hpp.
std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzRes2Norms | ( | ) | [inline, virtual] |
Get the current Ritz residual 2-norms.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 307 of file AnasaziBlockKrylovSchur.hpp.
std::vector<Value<ScalarType> > Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzValues | ( | ) | [inline, virtual] |
Get the Ritz values.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 272 of file AnasaziBlockKrylovSchur.hpp.
Teuchos::RCP<const MV> Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getRitzVectors | ( | ) | [inline, virtual] |
Get the Ritz vectors.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 263 of file AnasaziBlockKrylovSchur.hpp.
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
.
Definition at line 234 of file AnasaziBlockKrylovSchur.hpp.
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getStatusTest | ( | ) | const [inline, virtual] |
Get the current StatusTest used by the solver.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 1353 of file AnasaziBlockKrylovSchur.hpp.
int Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::getStepSize | ( | ) | const [inline] |
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::initialize | ( | ) | [inline, 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.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::initialize | ( | BlockKrylovSchurState< ScalarType, MV > | state | ) | [inline] |
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.
true
(see post-conditions of isInitialize())
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.
bool Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::isInitialized | ( | ) | const [inline, virtual] |
Indicates whether the solver has been initialized or not.
true:
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 225 of file AnasaziBlockKrylovSchur.hpp.
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.
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.
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.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::iterate | ( | ) | [inline, 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:
blockSize
vectors in the Krylov basis.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.
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.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setAuxVecs | ( | const Teuchos::Array< Teuchos::RCP< const MV > > & | auxvecs | ) | [inline, 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.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setBlockSize | ( | int | blockSize | ) | [inline, virtual] |
Set the blocksize.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 635 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setNumRitzVectors | ( | int | numRitzVecs | ) | [inline] |
Set the number of Ritz vectors to compute.
Definition at line 653 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setSize | ( | int | blockSize, | |
int | numBlocks | |||
) | [inline] |
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.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setStatusTest | ( | Teuchos::RCP< StatusTest< ScalarType, MV, OP > > | test | ) | [inline, virtual] |
Set a new StatusTest for the solver.
Implements Anasazi::Eigensolver< ScalarType, MV, OP >.
Definition at line 1344 of file AnasaziBlockKrylovSchur.hpp.
void Anasazi::BlockKrylovSchur< ScalarType, MV, OP >::setStepSize | ( | int | stepSize | ) | [inline] |