42 #ifndef ANASAZI_LOBPCG_SOLMGR_HPP 43 #define ANASAZI_LOBPCG_SOLMGR_HPP 66 #include "Teuchos_BLAS.hpp" 67 #include "Teuchos_TimeMonitor.hpp" 169 template<
class ScalarType,
class MV,
class OP>
175 typedef Teuchos::ScalarTraits<ScalarType> SCT;
176 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
177 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
209 Teuchos::ParameterList &pl );
234 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
235 return Teuchos::tuple(_timerSolve, _timerLocking);
293 Teuchos::RCP<Eigenproblem<ScalarType,MV,OP> > problem_;
295 std::string whch_, ortho_;
297 MagnitudeType convtol_, locktol_;
298 int maxIters_, numIters_;
300 bool relconvtol_, rellocktol_;
307 Teuchos::RCP<LOBPCGState<ScalarType,MV> > state_;
308 enum ResType convNorm_, lockNorm_;
310 Teuchos::RCP<Teuchos::Time> _timerSolve, _timerLocking;
312 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > globalTest_;
313 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > lockingTest_;
314 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > debugTest_;
319 template<
class ScalarType,
class MV,
class OP>
322 Teuchos::ParameterList &pl ) :
326 convtol_(MT::prec()),
338 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
339 , _timerSolve(Teuchos::TimeMonitor::getNewTimer(
"Anasazi: LOBPCGSolMgr::solve()")),
340 _timerLocking(Teuchos::TimeMonitor::getNewTimer(
"Anasazi: LOBPCGSolMgr locking"))
343 TEUCHOS_TEST_FOR_EXCEPTION(problem_ == Teuchos::null, std::invalid_argument,
"Problem not given to solver manager.");
344 TEUCHOS_TEST_FOR_EXCEPTION(!problem_->isProblemSet(), std::invalid_argument,
"Problem not set.");
345 TEUCHOS_TEST_FOR_EXCEPTION(!problem_->isHermitian(), std::invalid_argument,
"Problem not symmetric.");
346 TEUCHOS_TEST_FOR_EXCEPTION(problem_->getInitVec() == Teuchos::null,std::invalid_argument,
"Problem does not contain initial vectors to clone from.");
352 whch_ = pl.get(
"Which",whch_);
353 TEUCHOS_TEST_FOR_EXCEPTION(whch_ !=
"SM" && whch_ !=
"LM" && whch_ !=
"SR" && whch_ !=
"LR",
354 std::invalid_argument,
"Anasazi::LOBPCGSolMgr: Invalid sorting string.");
357 ortho_ = pl.get(
"Orthogonalization",ortho_);
358 if (ortho_ !=
"DGKS" && ortho_ !=
"SVQB") {
363 convtol_ = pl.get(
"Convergence Tolerance",convtol_);
364 relconvtol_ = pl.get(
"Relative Convergence Tolerance",relconvtol_);
365 strtmp = pl.get(
"Convergence Norm",std::string(
"2"));
367 convNorm_ = RES_2NORM;
369 else if (strtmp ==
"M") {
370 convNorm_ = RES_ORTH;
373 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
374 "Anasazi::LOBPCGSolMgr: Invalid Convergence Norm.");
379 useLocking_ = pl.get(
"Use Locking",useLocking_);
380 rellocktol_ = pl.get(
"Relative Locking Tolerance",rellocktol_);
382 locktol_ = convtol_/10;
383 locktol_ = pl.get(
"Locking Tolerance",locktol_);
384 strtmp = pl.get(
"Locking Norm",std::string(
"2"));
386 lockNorm_ = RES_2NORM;
388 else if (strtmp ==
"M") {
389 lockNorm_ = RES_ORTH;
392 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
393 "Anasazi::LOBPCGSolMgr: Invalid Locking Norm.");
397 maxIters_ = pl.get(
"Maximum Iterations",maxIters_);
400 blockSize_ = pl.get(
"Block Size",problem_->getNEV());
401 TEUCHOS_TEST_FOR_EXCEPTION(blockSize_ <= 0, std::invalid_argument,
402 "Anasazi::LOBPCGSolMgr: \"Block Size\" must be strictly positive.");
406 maxLocked_ = pl.get(
"Max Locked",problem_->getNEV());
411 if (maxLocked_ == 0) {
414 TEUCHOS_TEST_FOR_EXCEPTION(maxLocked_ < 0, std::invalid_argument,
415 "Anasazi::LOBPCGSolMgr: \"Max Locked\" must be positive.");
416 TEUCHOS_TEST_FOR_EXCEPTION(maxLocked_ + blockSize_ < problem_->getNEV(),
417 std::invalid_argument,
418 "Anasazi::LOBPCGSolMgr: Not enough storage space for requested number of eigenpairs.");
421 lockQuorum_ = pl.get(
"Locking Quorum",lockQuorum_);
422 TEUCHOS_TEST_FOR_EXCEPTION(lockQuorum_ <= 0,
423 std::invalid_argument,
424 "Anasazi::LOBPCGSolMgr: \"Locking Quorum\" must be strictly positive.");
428 fullOrtho_ = pl.get(
"Full Ortho",fullOrtho_);
431 if (pl.isParameter(
"Verbosity")) {
432 if (Teuchos::isParameterType<int>(pl,
"Verbosity")) {
433 verbosity_ = pl.get(
"Verbosity", verbosity_);
435 verbosity_ = (int)Teuchos::getParameter<Anasazi::MsgType>(pl,
"Verbosity");
440 recover_ = pl.get(
"Recover",recover_);
443 if (pl.isParameter(
"Init")) {
444 state_ = Teuchos::getParameter<Teuchos::RCP<Anasazi::LOBPCGState<ScalarType,MV> > >(pl,
"Init");
450 template<
class ScalarType,
class MV,
class OP>
456 const int nev = problem_->getNEV();
472 Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > maxtest;
477 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > convtest;
478 if (globalTest_ == Teuchos::null) {
482 convtest = globalTest_;
484 Teuchos::RCP<StatusTestWithOrdering<ScalarType,MV,OP> > ordertest
487 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > locktest;
489 if (lockingTest_ == Teuchos::null) {
493 locktest = lockingTest_;
497 Teuchos::Array<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > alltests;
498 alltests.push_back(ordertest);
499 if (locktest != Teuchos::null) alltests.push_back(locktest);
500 if (debugTest_ != Teuchos::null) alltests.push_back(debugTest_);
501 if (maxtest != Teuchos::null) alltests.push_back(maxtest);
502 Teuchos::RCP<StatusTestCombo<ScalarType,MV,OP> > combotest
505 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > outputtest;
506 if ( printer->isVerbosity(
Debug) ) {
515 Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> > ortho;
516 if (ortho_==
"SVQB") {
518 }
else if (ortho_==
"DGKS") {
521 TEUCHOS_TEST_FOR_EXCEPTION(ortho_!=
"SVQB"&&ortho_!=
"DGKS",std::logic_error,
"Anasazi::LOBPCGSolMgr::solve(): Invalid orthogonalization type.");
526 Teuchos::ParameterList plist;
527 plist.set(
"Block Size",blockSize_);
528 plist.set(
"Full Ortho",fullOrtho_);
532 Teuchos::RCP<LOBPCG<ScalarType,MV,OP> > lobpcg_solver
535 Teuchos::RCP< const MV > probauxvecs = problem_->getAuxVecs();
536 if (probauxvecs != Teuchos::null) {
537 lobpcg_solver->setAuxVecs( Teuchos::tuple< Teuchos::RCP<const MV> >(probauxvecs) );
544 int curNumLocked = 0;
545 Teuchos::RCP<MV> lockvecs;
547 lockvecs =
MVT::Clone(*problem_->getInitVec(),maxLocked_);
549 std::vector<MagnitudeType> lockvals;
558 Teuchos::RCP<MV> workMV;
559 if (fullOrtho_ ==
false && recover_ ==
true) {
560 workMV =
MVT::Clone(*problem_->getInitVec(),2*3*blockSize_);
562 else if (useLocking_) {
563 if (problem_->getM() != Teuchos::null) {
564 workMV =
MVT::Clone(*problem_->getInitVec(),4*blockSize_);
567 workMV =
MVT::Clone(*problem_->getInitVec(),2*blockSize_);
574 problem_->setSolution(sol);
577 if (state_ != Teuchos::null) {
578 lobpcg_solver->initialize(*state_);
583 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 584 Teuchos::TimeMonitor slvtimer(*_timerSolve);
590 lobpcg_solver->iterate();
597 if (debugTest_ != Teuchos::null && debugTest_->getStatus() ==
Passed) {
598 throw AnasaziError(
"Anasazi::LOBPCGSolMgr::solve(): User-specified debug status test returned Passed.");
605 else if (ordertest->getStatus() ==
Passed || (maxtest != Teuchos::null && maxtest->getStatus() ==
Passed) ) {
616 else if (locktest != Teuchos::null && locktest->getStatus() ==
Passed) {
618 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 619 Teuchos::TimeMonitor lcktimer(*_timerLocking);
623 TEUCHOS_TEST_FOR_EXCEPTION(locktest->howMany() <= 0,std::logic_error,
624 "Anasazi::LOBPCGSolMgr::solve(): status test mistake: howMany() non-positive.");
625 TEUCHOS_TEST_FOR_EXCEPTION(locktest->howMany() != (int)locktest->whichVecs().size(),std::logic_error,
626 "Anasazi::LOBPCGSolMgr::solve(): status test mistake: howMany() not consistent with whichVecs().");
627 TEUCHOS_TEST_FOR_EXCEPTION(curNumLocked == maxLocked_,std::logic_error,
628 "Anasazi::LOBPCGSolMgr::solve(): status test mistake: locking not deactivated.");
630 int numnew = locktest->howMany();
631 std::vector<int> indnew = locktest->whichVecs();
634 if (curNumLocked + numnew > maxLocked_) {
635 numnew = maxLocked_ - curNumLocked;
636 indnew.resize(numnew);
641 bool hadP = lobpcg_solver->hasP();
645 printer->print(
Debug,
"Locking vectors: ");
646 for (
unsigned int i=0; i<indnew.size(); i++) {printer->stream(
Debug) <<
" " << indnew[i];}
647 printer->print(
Debug,
"\n");
649 std::vector<MagnitudeType> newvals(numnew);
650 Teuchos::RCP<const MV> newvecs;
654 newvecs =
MVT::CloneView(*lobpcg_solver->getRitzVectors(),indnew);
656 std::vector<Value<ScalarType> > allvals = lobpcg_solver->getRitzValues();
657 for (
int i=0; i<numnew; i++) {
658 newvals[i] = allvals[indnew[i]].realpart;
663 std::vector<int> indlock(numnew);
664 for (
int i=0; i<numnew; i++) indlock[i] = curNumLocked+i;
666 newvecs = Teuchos::null;
669 lockvals.insert(lockvals.end(),newvals.begin(),newvals.end());
670 curNumLocked += numnew;
673 std::vector<int> indlock(curNumLocked);
674 for (
int i=0; i<curNumLocked; i++) indlock[i] = i;
675 Teuchos::RCP<const MV> curlocked =
MVT::CloneView(*lockvecs,indlock);
676 if (probauxvecs != Teuchos::null) {
677 lobpcg_solver->setAuxVecs( Teuchos::tuple< Teuchos::RCP<const MV> >(probauxvecs,curlocked) );
680 lobpcg_solver->setAuxVecs( Teuchos::tuple< Teuchos::RCP<const MV> >(curlocked) );
684 ordertest->setAuxVals(lockvals);
688 Teuchos::RCP<MV> newstateX, newstateMX, newstateP, newstateMP;
693 std::vector<int> bsind(blockSize_);
694 for (
int i=0; i<blockSize_; i++) bsind[i] = i;
698 if (state.
MX != Teuchos::null) {
699 std::vector<int> block3(blockSize_);
700 for (
int i=0; i<blockSize_; i++) block3[i] = 2*blockSize_+i;
710 if (newstateMX != Teuchos::null) {
716 Teuchos::Array<Teuchos::RCP<const MV> > curauxvecs = lobpcg_solver->getAuxVecs();
717 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > dummyC;
719 ortho->projectAndNormalizeMat(*newstateX,curauxvecs,dummyC,Teuchos::null,newstateMX);
724 std::vector<int> block2(blockSize_);
725 for (
int i=0; i<blockSize_; i++) block2[i] = blockSize_+i;
729 if (state.
MP != Teuchos::null) {
730 std::vector<int> block4(blockSize_);
731 for (
int i=0; i<blockSize_; i++) block4[i] = 3*blockSize_+i;
738 curauxvecs.push_back(newstateX);
739 ortho->projectAndNormalizeMat(*newstateP,curauxvecs,dummyC,Teuchos::null,newstateMP);
743 ortho->projectAndNormalizeMat(*newstateP,curauxvecs,dummyC,Teuchos::null,newstateMP);
748 newstate.
X = newstateX;
749 newstate.
MX = newstateMX;
750 newstate.
P = newstateP;
751 newstate.
MP = newstateMP;
752 lobpcg_solver->initialize(newstate);
755 if (curNumLocked == maxLocked_) {
757 combotest->removeTest(locktest);
761 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
"Anasazi::LOBPCGSolMgr::solve(): Invalid return from lobpcg_solver::iterate().");
770 if (fullOrtho_==
true || recover_==
false) {
774 printer->stream(
Warnings) <<
"Error! Caught LOBPCGRitzFailure at iteration " << lobpcg_solver->getNumIters() << std::endl
775 <<
"Will not try to recover." << std::endl;
778 printer->stream(
Warnings) <<
"Error! Caught LOBPCGRitzFailure at iteration " << lobpcg_solver->getNumIters() << std::endl
779 <<
"Full orthogonalization is off; will try to recover." << std::endl;
785 Teuchos::RCP<MV> restart, Krestart, Mrestart;
786 int localsize = lobpcg_solver->hasP() ? 3*blockSize_ : 2*blockSize_;
787 bool hasM = problem_->getM() != Teuchos::null;
789 std::vector<int> recind(localsize);
790 for (
int i=0; i<localsize; i++) recind[i] = i;
794 std::vector<int> recind(localsize);
795 for (
int i=0; i<localsize; i++) recind[i] = localsize+i;
809 std::vector<int> blk1(blockSize_);
810 for (
int i=0; i < blockSize_; i++) blk1[i] = i;
821 std::vector<int> blk2(blockSize_);
822 for (
int i=0; i < blockSize_; i++) blk2[i] = blockSize_+i;
831 if (localsize == 3*blockSize_) {
832 std::vector<int> blk3(blockSize_);
833 for (
int i=0; i < blockSize_; i++) blk3[i] = 2*blockSize_+i;
842 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > dummyC;
843 Teuchos::Array<Teuchos::RCP<const MV> > Q;
845 if (curNumLocked > 0) {
846 std::vector<int> indlock(curNumLocked);
847 for (
int i=0; i<curNumLocked; i++) indlock[i] = i;
848 Teuchos::RCP<const MV> curlocked =
MVT::CloneView(*lockvecs,indlock);
849 Q.push_back(curlocked);
851 if (probauxvecs != Teuchos::null) {
852 Q.push_back(probauxvecs);
855 int rank = ortho->projectAndNormalizeMat(*restart,Q,dummyC,Teuchos::null,Mrestart);
856 if (rank < blockSize_) {
858 printer->stream(
Errors) <<
"Error! Recovered basis only rank " << rank <<
". Block size is " << blockSize_ <<
".\n" 859 <<
"Recovery failed." << std::endl;
863 if (rank < localsize) {
865 std::vector<int> redind(localsize);
866 for (
int i=0; i<localsize; i++) redind[i] = i;
877 Teuchos::SerialDenseMatrix<int,ScalarType> KK(localsize,localsize), MM(localsize,localsize), S(localsize,localsize);
878 std::vector<MagnitudeType> theta(localsize);
885 OPT::Apply(*problem_->getOperator(),*restart,*Krestart);
890 msutils::directSolver(localsize,KK,Teuchos::rcpFromRef(MM),S,theta,rank,1);
891 if (rank < blockSize_) {
892 printer->stream(
Errors) <<
"Error! Recovered basis of rank " << rank <<
" produced only " << rank <<
"ritz vectors.\n" 893 <<
"Block size is " << blockSize_ <<
".\n" 894 <<
"Recovery failed." << std::endl;
901 Teuchos::BLAS<int,ScalarType> blas;
902 std::vector<int> order(rank);
904 sorter->sort( theta, Teuchos::rcpFromRef(order),rank );
906 Teuchos::SerialDenseMatrix<int,ScalarType> curS(Teuchos::View,S,rank,rank);
907 msutils::permuteVectors(order,curS);
910 Teuchos::SerialDenseMatrix<int,ScalarType> S1(Teuchos::View,S,localsize,blockSize_);
914 Teuchos::RCP<MV> newX;
916 std::vector<int> bsind(blockSize_);
917 for (
int i=0; i<blockSize_; i++) bsind[i] = i;
923 theta.resize(blockSize_);
924 newstate.
T = Teuchos::rcpFromRef(theta);
926 lobpcg_solver->initialize(newstate);
930 <<
"Anasazi::LOBPCGSolMgr::solve() caught unexpected exception from Anasazi::LOBPCG::iterate() at iteration " << lobpcg_solver->getNumIters() << std::endl
931 << err.what() << std::endl
932 <<
"Anasazi::LOBPCGSolMgr::solve() returning Unconverged with no solutions." << std::endl;
938 sol.numVecs = ordertest->howMany();
939 if (sol.numVecs > 0) {
940 sol.Evecs =
MVT::Clone(*problem_->getInitVec(),sol.numVecs);
941 sol.Espace = sol.Evecs;
942 sol.Evals.resize(sol.numVecs);
943 std::vector<MagnitudeType> vals(sol.numVecs);
946 std::vector<int> which = ordertest->whichVecs();
950 std::vector<int> inlocked(0), insolver(0);
951 for (
unsigned int i=0; i<which.size(); i++) {
953 TEUCHOS_TEST_FOR_EXCEPTION(which[i] >= blockSize_,std::logic_error,
"Anasazi::LOBPCGSolMgr::solve(): positive indexing mistake from ordertest.");
954 insolver.push_back(which[i]);
958 TEUCHOS_TEST_FOR_EXCEPTION(which[i] < -curNumLocked,std::logic_error,
"Anasazi::LOBPCGSolMgr::solve(): negative indexing mistake from ordertest.");
959 inlocked.push_back(which[i] + curNumLocked);
963 TEUCHOS_TEST_FOR_EXCEPTION(insolver.size() + inlocked.size() != (
unsigned int)sol.numVecs,std::logic_error,
"Anasazi::LOBPCGSolMgr::solve(): indexing mistake.");
966 if (insolver.size() > 0) {
968 int lclnum = insolver.size();
969 std::vector<int> tosol(lclnum);
970 for (
int i=0; i<lclnum; i++) tosol[i] = i;
971 Teuchos::RCP<const MV> v =
MVT::CloneView(*lobpcg_solver->getRitzVectors(),insolver);
974 std::vector<Value<ScalarType> > fromsolver = lobpcg_solver->getRitzValues();
975 for (
unsigned int i=0; i<insolver.size(); i++) {
976 vals[i] = fromsolver[insolver[i]].realpart;
981 if (inlocked.size() > 0) {
982 int solnum = insolver.size();
984 int lclnum = inlocked.size();
985 std::vector<int> tosol(lclnum);
986 for (
int i=0; i<lclnum; i++) tosol[i] = solnum + i;
990 for (
unsigned int i=0; i<inlocked.size(); i++) {
991 vals[i+solnum] = lockvals[inlocked[i]];
997 std::vector<int> order(sol.numVecs);
998 sorter->sort( vals, Teuchos::rcpFromRef(order), sol.numVecs);
1000 for (
int i=0; i<sol.numVecs; i++) {
1001 sol.Evals[i].realpart = vals[i];
1002 sol.Evals[i].imagpart = MT::zero();
1005 msutils::permuteVectors(sol.numVecs,order,*sol.Evecs);
1009 sol.index.resize(sol.numVecs,0);
1014 lobpcg_solver->currentStatus(printer->stream(
FinalSummary));
1017 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR 1019 Teuchos::TimeMonitor::summarize( printer->stream(
TimingDetails ) );
1023 problem_->setSolution(sol);
1024 printer->stream(
Debug) <<
"Returning " << sol.numVecs <<
" eigenpairs to eigenproblem." << std::endl;
1027 numIters_ = lobpcg_solver->getNumIters();
1029 if (sol.numVecs < nev) {
1036 template <
class ScalarType,
class MV,
class OP>
1041 globalTest_ = global;
1044 template <
class ScalarType,
class MV,
class OP>
1045 const Teuchos::RCP< StatusTest<ScalarType,MV,OP> > &
1051 template <
class ScalarType,
class MV,
class OP>
1059 template <
class ScalarType,
class MV,
class OP>
1060 const Teuchos::RCP< StatusTest<ScalarType,MV,OP> > &
1066 template <
class ScalarType,
class MV,
class OP>
1071 lockingTest_ = locking;
1074 template <
class ScalarType,
class MV,
class OP>
1075 const Teuchos::RCP< StatusTest<ScalarType,MV,OP> > &
1078 return lockingTest_;
Pure virtual base class which describes the basic interface for a solver manager. ...
static void MvRandom(MV &mv)
Replace the vectors in mv with random vectors.
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta, MV &mv)
Update mv with .
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getLockingStatusTest() const
Get the status test defining locking.
ResType
Enumerated type used to specify which residual norm used by residual norm status tests.
A special StatusTest for printing other status tests.
This class defines the interface required by an eigensolver and status test class to compute solution...
LOBPCGSolMgr(const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, Teuchos::ParameterList &pl)
Basic constructor for LOBPCGSolMgr.
An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques...
This class provides the Locally Optimal Block Preconditioned Conjugate Gradient (LOBPCG) iteration...
Virtual base class which defines basic traits for the operator type.
ReturnType solve()
This method performs possibly repeated calls to the underlying eigensolver's iterate() routine until ...
Status test for forming logical combinations of other status tests.
Teuchos::RCP< const MultiVector > H
The current preconditioned residual vectors.
int getNumIters() const
Get the iteration count for the most recent call to solve().
The Anasazi::SolverManager is a templated virtual base class that defines the basic interface that an...
Teuchos::RCP< const MultiVector > P
The current search direction.
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.
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using the SVQB iter...
An exception class parent to all Anasazi exceptions.
Implementation of the locally-optimal block preconditioned conjugate gradient (LOBPCG) method...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
Teuchos::RCP< const std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > > T
The current Ritz values.
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
Anasazi's templated, static class providing utilities for the solvers.
int numVecs
The number of computed eigenpairs.
Basic output manager for sending information of select verbosity levels to the appropriate output str...
Anasazi's basic output manager for sending information of select verbosity levels to the appropriate ...
Abstract base class which defines the interface required by an eigensolver and status test class to c...
ReturnType
Enumerated type used to pass back information from a solver manager.
const Eigenproblem< ScalarType, MV, OP > & getProblem() const
Return the eigenvalue problem.
A status test for testing the norm of the eigenvectors residuals.
Traits class which defines basic operations on multivectors.
static void MvTransMv(const ScalarType alpha, const MV &A, const MV &B, Teuchos::SerialDenseMatrix< int, ScalarType > &C)
Compute C := alpha * A^H B.
Teuchos::RCP< const MultiVector > MX
The image of the current eigenvectors under M, or Teuchos::null if M was not specified.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
void setDebugStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &debug)
Set the status test for debugging.
Orthogonalization manager based on the SVQB technique described in "A Block Orthogonalization Procedu...
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
Creates a new MV that shares the selected contents of mv (shallow copy).
Struct for storing an eigenproblem solution.
void setLockingStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &locking)
Set the status test defining locking.
static Teuchos::RCP< const MV > CloneView(const MV &mv, const std::vector< int > &index)
Creates a new const MV that shares the selected contents of mv (shallow copy).
static void SetBlock(const MV &A, const std::vector< int > &index, MV &mv)
Copy the vectors in A to a set of vectors in mv indicated by the indices given in index...
Teuchos::RCP< const MultiVector > MH
The image of the current preconditioned residual vectors under M, or Teuchos::null if M was not speci...
A status test for testing the number of iterations.
Status test for testing the number of iterations.
Special StatusTest for printing status tests.
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
LOBPCGRitzFailure is thrown when the LOBPCG solver is unable to continue a call to LOBPCG::iterate() ...
Status test for forming logical combinations of other status tests.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using (potentially)...
Types and exceptions used within Anasazi solvers and interfaces.
void setGlobalStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &global)
Set the status test defining global convergence.
virtual ~LOBPCGSolMgr()
Destructor.
Teuchos::RCP< const MultiVector > MP
The image of the current search direction under M, or Teuchos::null if M was not specified.
Common interface of stopping criteria for Anasazi's solvers.
A status test for testing the norm of the eigenvectors residuals.
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getGlobalStatusTest() const
Get the status test defining global convergence.
Basic implementation of the Anasazi::OrthoManager class.
User interface for the LOBPCG eigensolver.
Structure to contain pointers to Anasazi state variables.
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getDebugStatusTest() const
Get the status test for debugging.
Teuchos::RCP< const MultiVector > X
The current eigenvectors.
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
Class which provides internal utilities for the Anasazi solvers.