42#ifndef ANASAZI_TRACEMIN_SOLMGR_HPP
43#define ANASAZI_TRACEMIN_SOLMGR_HPP
65#include "Teuchos_BLAS.hpp"
66#include "Teuchos_LAPACK.hpp"
67#include "Teuchos_TimeMonitor.hpp"
69# include <Teuchos_FancyOStream.hpp>
79template<
class ScalarType,
class MV,
class OP>
116 typedef MultiVecTraits<ScalarType,MV> MVT;
117 typedef OperatorTraits<ScalarType,MV,OP> OPT;
118 typedef Teuchos::ScalarTraits<ScalarType> SCT;
119 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
120 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
137 TraceMinSolMgr(
const Teuchos::RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
138 Teuchos::ParameterList &pl );
146 bool exceededMaxIter() {
return (this->iter_ >= maxits_); };
149 bool needToRestart(
const Teuchos::RCP< TraceMinBase<ScalarType,MV,OP> > solver) {
return false; };
152 bool performRestart(
int &numRestarts, Teuchos::RCP< TraceMinBase<ScalarType,MV,OP> > solver)
153 { TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"Anasazi::TraceMinSolMgr::performRestart(): TraceMin does not perform restarts!"); };
156 Teuchos::RCP< TraceMinBase<ScalarType,MV,OP> > createSolver(
157 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
158 const Teuchos::RCP<StatusTest<ScalarType,MV,OP> > &outputtest,
159 const Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> > &ortho,
160 Teuchos::ParameterList &plist
170template <
class MagnitudeType,
class MV,
class OP>
175 typedef std::complex<MagnitudeType> ScalarType;
177 const RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
178 Teuchos::ParameterList &pl )
181 MagnitudeType::this_class_is_missing_a_specialization();
187template<
class ScalarType,
class MV,
class OP>
192 maxits_ = pl.get(
"Maximum Iterations", 100);
193 TEUCHOS_TEST_FOR_EXCEPTION(maxits_ < 1, std::invalid_argument,
"Anasazi::TraceMinSolMgr::constructor(): \"Maximum Iterations\" must be strictly positive.");
197 this->blockSize_ = pl.get(
"Block Size",2*this->problem_->getNEV());
198 TEUCHOS_TEST_FOR_EXCEPTION(this->blockSize_ < this->problem_->getNEV(), std::invalid_argument,
199 "Anasazi::TraceMinSolMgr::constructor(): \"Block Size\" must be greater than or equal to the number of desired eigenpairs.");
201 this->useHarmonic_ = pl.get(
"Use Harmonic Ritz Values",
false);
202 TEUCHOS_TEST_FOR_EXCEPTION(this->useHarmonic_, std::invalid_argument,
203 "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?");
206 this->numBlocks_ = 1;
207 this->numRestartBlocks_ = 1;
209 TEUCHOS_TEST_FOR_EXCEPTION(
static_cast<ptrdiff_t
>(this->numBlocks_)*this->blockSize_ + this->maxLocked_ > MVT::GetGlobalLength(*this->problem_->getInitVec()),
210 std::invalid_argument,
211 "Anasazi::TraceMinSolMgr::constructor(): Potentially impossible orthogonality requests. Reduce basis size or locking size.");
213 TEUCHOS_TEST_FOR_EXCEPTION(this->maxLocked_ + this->blockSize_ < this->problem_->getNEV(), std::invalid_argument,
214 "Anasazi::TraceMinDavidsonSolMgr: Not enough storage space for requested number of eigenpairs.");
220template <
class ScalarType,
class MV,
class OP>
222 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
223 const Teuchos::RCP<StatusTest<ScalarType,MV,OP> > &outputtest,
224 const Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> > &ortho,
225 Teuchos::ParameterList &plist
228 return Teuchos::rcp(
new TraceMin<ScalarType,MV,OP>(this->problem_,sorter,this->printer_,outputtest,ortho,plist) );
Basic implementation of the Anasazi::SortManager class.
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
Abstract base class which defines the interface required by an eigensolver and status test class to c...
Abstract class definition for Anasazi Output Managers.
Class which provides internal utilities for the Anasazi solvers.
Status test for forming logical combinations of other status tests.
Special StatusTest for printing status tests.
A status test for testing the norm of the eigenvectors residuals.
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
The Anasazi::TraceMinBaseSolMgr provides an abstract base class for the TraceMin series of solver man...
Implementation of the trace minimization eigensolver.
Types and exceptions used within Anasazi solvers and interfaces.
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.
TraceMinSolMgr(const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, Teuchos::ParameterList &pl)
Basic constructor for TraceMinSolMgr.
Anasazi's templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.