49 #ifndef ANASAZI_TRACEMIN_HPP 50 #define ANASAZI_TRACEMIN_HPP 56 #include "Epetra_Operator.h" 61 #include "Teuchos_ScalarTraits.hpp" 66 #include "Teuchos_LAPACK.hpp" 67 #include "Teuchos_BLAS.hpp" 68 #include "Teuchos_SerialDenseMatrix.hpp" 69 #include "Teuchos_SerialDenseSolver.hpp" 70 #include "Teuchos_ParameterList.hpp" 71 #include "Teuchos_TimeMonitor.hpp" 128 template <
class ScalarType,
class MV,
class OP>
175 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
179 Teuchos::ParameterList ¶ms
189 typedef Teuchos::ScalarTraits<ScalarType> SCT;
190 typedef typename SCT::magnitudeType MagnitudeType;
191 const MagnitudeType ONE;
192 const MagnitudeType ZERO;
193 const MagnitudeType NANVAL;
196 void addToBasis(
const Teuchos::RCP<const MV> Delta);
198 void harmonicAddToBasis(
const Teuchos::RCP<const MV> Delta);
212 template <
class ScalarType,
class MV,
class OP>
215 const Teuchos::RCP<
SortManager<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > &sorter,
219 Teuchos::ParameterList ¶ms
221 TraceMinBase<ScalarType,MV,OP>(problem,sorter,printer,tester,ortho,params),
222 ONE(Teuchos::ScalarTraits<MagnitudeType>::one()),
223 ZERO(Teuchos::ScalarTraits<MagnitudeType>::zero()),
224 NANVAL(Teuchos::ScalarTraits<MagnitudeType>::nan())
229 template <
class ScalarType,
class MV,
class OP>
236 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 237 Teuchos::TimeMonitor lcltimer( *this->timerMOp_ );
239 this->count_ApplyM_+= this->blockSize_;
246 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 247 Teuchos::TimeMonitor lcltimer( *this->timerOrtho_ );
250 if(this->numAuxVecs_ > 0)
252 rank = this->orthman_->projectAndNormalizeMat(*this->V_,this->auxVecs_,
253 Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)),
254 Teuchos::null,this->MV_,this->MauxVecs_);
258 rank = this->orthman_->normalizeMat(*this->V_,Teuchos::null,this->MV_);
267 if(this->Op_ != Teuchos::null)
269 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 270 Teuchos::TimeMonitor lcltimer( *this->timerOp_ );
272 this->count_ApplyOp_+= this->blockSize_;
279 template <
class ScalarType,
class MV,
class OP>
286 if(this->numAuxVecs_ > 0)
288 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 289 Teuchos::TimeMonitor lcltimer( *this->timerOrtho_ );
291 this->orthman_->projectMat(*this->V_,this->auxVecs_);
295 if(this->Op_ != Teuchos::null)
297 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 298 Teuchos::TimeMonitor lcltimer( *this->timerOp_ );
300 this->count_ApplyOp_+= this->blockSize_;
306 RCP< Teuchos::SerialDenseMatrix<int,ScalarType> > gamma = rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>(this->blockSize_,this->blockSize_));
307 int rank = this->orthman_->normalizeMat(*this->KV_,gamma);
312 Teuchos::SerialDenseSolver<int,ScalarType> SDsolver;
313 SDsolver.setMatrix(gamma);
321 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 322 Teuchos::TimeMonitor lcltimer( *this->timerMOp_ );
324 this->count_ApplyM_+= this->blockSize_;
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta, MV &mv)
Update mv with .
Abstract base class for trace minimization eigensolvers.
This class implements a TraceMIN iteration, a preconditioned iteration for solving linear symmetric p...
Templated virtual class for providing orthogonalization/orthonormalization methods with matrix-based ...
This class defines the interface required by an eigensolver and status test class to compute solution...
Declaration of basic traits for the multivector type.
Virtual base class which defines basic traits for the operator type.
TraceMin(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< MatOrthoManager< ScalarType, MV, OP > > &ortho, Teuchos::ParameterList ¶ms)
TraceMin constructor with eigenproblem, solver utilities, and parameter list of solver options...
static void Apply(const OP &Op, const MV &x, MV &y)
Application method which performs operation y = Op*x. An OperatorError exception is thrown if there i...
Basic implementation of the Anasazi::SortManager class.
Pure virtual base class which describes the basic interface to the iterative eigensolver.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
Anasazi's templated, static class providing utilities for the solvers.
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
Output managers remove the need for the eigensolver to know any information about the required output...
Traits class which defines basic operations on multivectors.
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
Virtual base class which defines basic traits for the operator type.
static void MvAddMv(const ScalarType alpha, const MV &A, const ScalarType beta, const MV &B, MV &mv)
Replace mv with .
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.
Class which provides internal utilities for the Anasazi solvers.