29 #ifndef ANASAZI_TRACEMIN_SOLMGR_HPP 30 #define ANASAZI_TRACEMIN_SOLMGR_HPP 52 #include "Teuchos_BLAS.hpp" 53 #include "Teuchos_LAPACK.hpp" 54 #include "Teuchos_TimeMonitor.hpp" 56 # include <Teuchos_FancyOStream.hpp> 66 template<
class ScalarType,
class MV,
class OP>
105 typedef Teuchos::ScalarTraits<ScalarType> SCT;
106 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
107 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
125 Teuchos::ParameterList &pl );
133 bool exceededMaxIter() {
return (this->iter_ >= maxits_); };
140 { TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"Anasazi::TraceMinSolMgr::performRestart(): TraceMin does not perform restarts!"); };
143 Teuchos::RCP< TraceMinBase<ScalarType,MV,OP> > createSolver(
144 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
147 Teuchos::ParameterList &plist
154 template<
class ScalarType,
class MV,
class OP>
159 maxits_ = pl.get(
"Maximum Iterations", 100);
160 TEUCHOS_TEST_FOR_EXCEPTION(maxits_ < 1, std::invalid_argument,
"Anasazi::TraceMinSolMgr::constructor(): \"Maximum Iterations\" must be strictly positive.");
164 this->blockSize_ = pl.get(
"Block Size",2*this->problem_->getNEV());
165 TEUCHOS_TEST_FOR_EXCEPTION(this->blockSize_ < this->problem_->getNEV(), std::invalid_argument,
166 "Anasazi::TraceMinSolMgr::constructor(): \"Block Size\" must be greater than or equal to the number of desired eigenpairs.");
168 this->useHarmonic_ = pl.get(
"Use Harmonic Ritz Values",
false);
169 TEUCHOS_TEST_FOR_EXCEPTION(this->useHarmonic_, std::invalid_argument,
170 "Anasazi::TraceMinSolMgr::constructor(): Please disable the harmonic Ritz values. It doesn't make sense to use them with TraceMin, which does not use expanding subspaces. Perhaps you wanted TraceMin-Davidson?");
173 this->numBlocks_ = 1;
174 this->numRestartBlocks_ = 1;
176 TEUCHOS_TEST_FOR_EXCEPTION(static_cast<ptrdiff_t>(this->numBlocks_)*this->blockSize_ + this->maxLocked_ >
MVT::GetGlobalLength(*this->problem_->getInitVec()),
177 std::invalid_argument,
178 "Anasazi::TraceMinSolMgr::constructor(): Potentially impossible orthogonality requests. Reduce basis size or locking size.");
180 TEUCHOS_TEST_FOR_EXCEPTION(this->maxLocked_ + this->blockSize_ < this->problem_->getNEV(), std::invalid_argument,
181 "Anasazi::TraceMinDavidsonSolMgr: Not enough storage space for requested number of eigenpairs.");
187 template <
class ScalarType,
class MV,
class OP>
189 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
192 Teuchos::ParameterList &plist
static ptrdiff_t GetGlobalLength(const MV &mv)
Return the number of rows in the given multivector mv.
This class implements a TraceMIN iteration, a preconditioned iteration for solving linear symmetric p...
This class defines the interface required by an eigensolver and status test class to compute solution...
Virtual base class which defines basic traits for the operator type.
Basic implementation of the Anasazi::SortManager class.
The Anasazi::TraceMinBaseSolMgr provides an abstract base class for the TraceMin series of solver man...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
Basic output manager for sending information of select verbosity levels to the appropriate output str...
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
TraceMinSolMgr(const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, Teuchos::ParameterList &pl)
Basic constructor for TraceMinSolMgr.
Abstract base class which defines the interface required by an eigensolver and status test class to c...
A status test for testing the norm of the eigenvectors residuals.
Traits class which defines basic operations on multivectors.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
The Anasazi::TraceMinBaseSolMgr provides an abstract base class for the TraceMin series of solver man...
The Anasazi::TraceMinSolMgr provides a flexible solver manager over the TraceMin eigensolver.
Special StatusTest for printing status tests.
Status test for forming logical combinations of other status tests.
Types and exceptions used within Anasazi solvers and interfaces.
This is an abstract base class for the trace minimization eigensolvers.
Anasazi's templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Common interface of stopping criteria for Anasazi's solvers.
Implementation of the trace minimization eigensolver.
Class which provides internal utilities for the Anasazi solvers.