10 #ifndef ANASAZI_BLOCKDAVIDSON_SOLMGR_HPP
11 #define ANASAZI_BLOCKDAVIDSON_SOLMGR_HPP
37 #include "Teuchos_FancyOStream.hpp"
88 template<
class ScalarType,
class MV,
class OP>
156 return Teuchos::tuple(_timerSolve, _timerRestarting, _timerLocking);
210 std::string whch_, ortho_;
212 MagnitudeType convtol_, locktol_;
215 bool relconvtol_, rellocktol_;
216 int blockSize_, numBlocks_, numIters_;
220 int numRestartBlocks_;
221 enum ResType convNorm_, lockNorm_;
234 template<
class ScalarType,
class MV,
class OP>
241 convtol_(
MT::prec()),
251 inSituRestart_(false),
253 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
254 , _timerSolve(Teuchos::TimeMonitor::getNewTimer(
"Anasazi: BlockDavidsonSolMgr::solve()")),
255 _timerRestarting(Teuchos::TimeMonitor::getNewTimer(
"Anasazi: BlockDavidsonSolMgr restarting")),
256 _timerLocking(Teuchos::TimeMonitor::getNewTimer(
"Anasazi: BlockDavidsonSolMgr locking"))
262 TEUCHOS_TEST_FOR_EXCEPTION(problem_->getInitVec() == Teuchos::null,std::invalid_argument,
"Problem does not contain initial vectors to clone from.");
267 whch_ = pl.
get(
"Which",whch_);
268 TEUCHOS_TEST_FOR_EXCEPTION(whch_ !=
"SM" && whch_ !=
"LM" && whch_ !=
"SR" && whch_ !=
"LR",std::invalid_argument,
"Invalid sorting string.");
271 ortho_ = pl.
get(
"Orthogonalization",ortho_);
272 if (ortho_ !=
"DGKS" && ortho_ !=
"SVQB") {
277 convtol_ = pl.
get(
"Convergence Tolerance",convtol_);
278 relconvtol_ = pl.
get(
"Relative Convergence Tolerance",relconvtol_);
279 strtmp = pl.
get(
"Convergence Norm",std::string(
"2"));
281 convNorm_ = RES_2NORM;
283 else if (strtmp ==
"M") {
284 convNorm_ = RES_ORTH;
288 "Anasazi::BlockDavidsonSolMgr: Invalid Convergence Norm.");
292 useLocking_ = pl.
get(
"Use Locking",useLocking_);
293 rellocktol_ = pl.
get(
"Relative Locking Tolerance",rellocktol_);
295 locktol_ = convtol_/10;
296 locktol_ = pl.
get(
"Locking Tolerance",locktol_);
297 strtmp = pl.
get(
"Locking Norm",std::string(
"2"));
299 lockNorm_ = RES_2NORM;
301 else if (strtmp ==
"M") {
302 lockNorm_ = RES_ORTH;
306 "Anasazi::BlockDavidsonSolMgr: Invalid Locking Norm.");
310 maxRestarts_ = pl.
get(
"Maximum Restarts",maxRestarts_);
313 blockSize_ = pl.
get(
"Block Size",problem_->getNEV());
315 "Anasazi::BlockDavidsonSolMgr: \"Block Size\" must be strictly positive.");
316 numBlocks_ = pl.
get(
"Num Blocks",2);
318 "Anasazi::BlockDavidsonSolMgr: \"Num Blocks\" must be >= 1.");
322 maxLocked_ = pl.
get(
"Max Locked",problem_->getNEV());
327 if (maxLocked_ == 0) {
331 "Anasazi::BlockDavidsonSolMgr: \"Max Locked\" must be positive.");
333 std::invalid_argument,
334 "Anasazi::BlockDavidsonSolMgr: Not enough storage space for requested number of eigenpairs.");
336 std::invalid_argument,
337 "Anasazi::BlockDavidsonSolMgr: Potentially impossible orthogonality requests. Reduce basis size or locking size.");
340 lockQuorum_ = pl.
get(
"Locking Quorum",lockQuorum_);
342 std::invalid_argument,
343 "Anasazi::BlockDavidsonSolMgr: \"Locking Quorum\" must be strictly positive.");
347 numRestartBlocks_ = pl.
get(
"Num Restart Blocks",numRestartBlocks_);
349 "Anasazi::BlockDavidsonSolMgr: \"Num Restart Blocks\" must be strictly positive.");
351 "Anasazi::BlockDavidsonSolMgr: \"Num Restart Blocks\" must be strictly less than \"Num Blocks\".");
355 if (Teuchos::isParameterType<bool>(pl,
"In Situ Restarting")) {
356 inSituRestart_ = pl.
get(
"In Situ Restarting",inSituRestart_);
358 inSituRestart_ = ( Teuchos::getParameter<int>(pl,
"In Situ Restarting") != 0 );
365 int osProc = pl.
get(
"Output Processor", 0);
372 osp = Teuchos::getParameter<Teuchos::RCP<Teuchos::FancyOStream> >(pl,
"Output Stream");
381 if (Teuchos::isParameterType<int>(pl,
"Verbosity")) {
382 verbosity = pl.
get(
"Verbosity", verbosity);
384 verbosity = (int)Teuchos::getParameter<Anasazi::MsgType>(pl,
"Verbosity");
393 template<
class ScalarType,
class MV,
class OP>
399 const int nev = problem_->getNEV();
403 out = Teuchos::getFancyOStream(Teuchos::rcpFromRef(printer_->stream(
Debug)));
405 *out <<
"Entering Anasazi::BlockDavidsonSolMgr::solve()\n";
417 if (globalTest_ == Teuchos::null) {
421 convtest = globalTest_;
428 if (lockingTest_ == Teuchos::null) {
432 locktest = lockingTest_;
438 if (locktest != Teuchos::null) alltests.
push_back(locktest);
439 if (debugTest_ != Teuchos::null) alltests.
push_back(debugTest_);
445 if ( printer_->isVerbosity(
Debug) ) {
455 if (ortho_==
"SVQB") {
457 }
else if (ortho_==
"DGKS") {
460 TEUCHOS_TEST_FOR_EXCEPTION(ortho_!=
"SVQB"&&ortho_!=
"DGKS",std::logic_error,
"Anasazi::BlockDavidsonSolMgr::solve(): Invalid orthogonalization type.");
466 plist.
set(
"Block Size",blockSize_);
467 plist.
set(
"Num Blocks",numBlocks_);
475 if (probauxvecs != Teuchos::null) {
483 int curNumLocked = 0;
490 if (maxLocked_ > 0) {
491 lockvecs = MVT::Clone(*problem_->getInitVec(),maxLocked_);
493 std::vector<MagnitudeType> lockvals;
542 if (inSituRestart_ ==
false) {
544 if (useLocking_==
true || maxRestarts_ > 0) {
545 workMV = MVT::Clone(*problem_->getInitVec(),(numBlocks_-1)*blockSize_);
549 workMV = Teuchos::null;
558 if (maxRestarts_ > 0) {
559 workMV = MVT::Clone(*problem_->getInitVec(),1);
562 workMV = Teuchos::null;
567 const ScalarType ONE = SCT::one();
568 const ScalarType ZERO = SCT::zero();
575 problem_->setSolution(sol);
581 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
588 bd_solver->iterate();
595 if (debugTest_ != Teuchos::null && debugTest_->getStatus() ==
Passed) {
596 throw AnasaziError(
"Anasazi::BlockDavidsonSolMgr::solve(): User-specified debug status test returned Passed.");
603 else if (ordertest->getStatus() ==
Passed ) {
614 else if ( bd_solver->getCurSubspaceDim() == bd_solver->getMaxSubspaceDim() ) {
616 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
620 if ( numRestarts >= maxRestarts_ ) {
625 printer_->stream(
IterationDetails) <<
" Performing restart number " << numRestarts <<
" of " << maxRestarts_ << std::endl << std::endl;
628 int curdim = state.
curDim;
629 int newdim = numRestartBlocks_*blockSize_;
631 # ifdef TEUCHOS_DEBUG
633 std::vector<Value<ScalarType> > ritzvalues = bd_solver->getRitzValues();
634 *out <<
"Ritz values from solver:\n";
635 for (
unsigned int i=0; i<ritzvalues.size(); i++) {
636 *out << ritzvalues[i].realpart <<
" ";
645 std::vector<MagnitudeType> theta(curdim);
647 # ifdef TEUCHOS_DEBUG
649 std::stringstream os;
650 os <<
"KK before HEEV...\n"
655 int info = msutils::directSolver(curdim,*state.
KK,Teuchos::null,S,theta,rank,10);
657 "Anasazi::BlockDavidsonSolMgr::solve(): error calling SolverUtils::directSolver.");
659 "Anasazi::BlockDavidsonSolMgr::solve(): direct solve did not compute all eigenvectors.");
661 # ifdef TEUCHOS_DEBUG
663 std::stringstream os;
664 *out <<
"Ritz values from heev(KK):\n";
665 for (
unsigned int i=0; i<theta.size(); i++) *out << theta[i] <<
" ";
666 os <<
"\nRitz vectors from heev(KK):\n"
675 std::vector<int> order(curdim);
676 sorter->sort(theta,Teuchos::rcpFromRef(order),curdim);
679 msutils::permuteVectors(order,S);
681 # ifdef TEUCHOS_DEBUG
683 std::stringstream os;
684 *out <<
"Ritz values from heev(KK) after sorting:\n";
685 std::copy(theta.begin(), theta.end(), std::ostream_iterator<ScalarType>(*out,
" "));
686 os <<
"\nRitz vectors from heev(KK) after sorting:\n"
694 # ifdef TEUCHOS_DEBUG
696 std::stringstream os;
697 os <<
"Significant primitive Ritz vectors:\n"
712 "Anasazi::BlockDavidsonSolMgr::solve(): Logic error calling SerialDenseMatrix::multiply.");
716 "Anasazi::BlockDavidsonSolMgr::solve(): Logic error calling SerialDenseMatrix::multiply.");
718 for (
int j=0; j<newdim-1; ++j) {
719 for (
int i=j+1; i<newdim; ++i) {
720 newKK(i,j) = SCT::conjugate(newKK(j,i));
724 # ifdef TEUCHOS_DEBUG
726 std::stringstream os;
736 rstate.
KK = Teuchos::rcpFromRef(newKK);
743 rstate.
KX = state.
KX;
744 rstate.
MX = state.
MX;
746 rstate.
T =
Teuchos::rcp(
new std::vector<MagnitudeType>(theta.begin(),theta.begin()+newdim) );
748 if (inSituRestart_ ==
true) {
749 # ifdef TEUCHOS_DEBUG
750 *out <<
"Beginning in-situ restart...\n";
758 std::vector<ScalarType> tau(newdim), work(newdim);
760 lapack.
GEQRF(curdim,newdim,Sr.
values(),Sr.
stride(),&tau[0],&work[0],work.size(),&geqrf_info);
762 "Anasazi::BlockDavidsonSolMgr::solve(): error calling GEQRF during restarting.");
763 if (printer_->isVerbosity(
Debug)) {
765 for (
int j=0; j<newdim; j++) {
766 R(j,j) = SCT::magnitude(R(j,j)) - 1.0;
767 for (
int i=j+1; i<newdim; i++) {
771 printer_->stream(
Debug) <<
"||Triangular factor of Sr - I||: " << R.
normFrobenius() << std::endl;
778 std::vector<int> curind(curdim);
779 for (
int i=0; i<curdim; i++) curind[i] = i;
781 msutils::applyHouse(newdim,*oldV,Sr,tau,workMV);
787 rstate.
V = solverbasis;
790 # ifdef TEUCHOS_DEBUG
791 *out <<
"Beginning ex-situ restart...\n";
794 std::vector<int> curind(curdim), newind(newdim);
795 for (
int i=0; i<curdim; i++) curind[i] = i;
796 for (
int i=0; i<newdim; i++) newind[i] = i;
800 MVT::MvTimesMatAddMv(ONE,*oldV,Sr,ZERO,*newV);
808 bd_solver->initialize(rstate);
815 else if (locktest != Teuchos::null && locktest->getStatus() ==
Passed) {
817 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
824 const int curdim = state.
curDim;
829 "Anasazi::BlockDavidsonSolMgr::solve(): status test mistake: howMany() non-positive.");
831 "Anasazi::BlockDavidsonSolMgr::solve(): status test mistake: howMany() not consistent with whichVecs().");
834 "Anasazi::BlockDavidsonSolMgr::solve(): status test mistake: locking not deactivated.");
837 std::vector<int> tmp_vector_int;
838 if (curNumLocked + locktest->howMany() > maxLocked_) {
840 tmp_vector_int.insert(tmp_vector_int.begin(),locktest->whichVecs().begin(),locktest->whichVecs().begin()+maxLocked_-curNumLocked);
843 tmp_vector_int = locktest->whichVecs();
845 const std::vector<int> lockind(tmp_vector_int);
846 const int numNewLocked = lockind.size();
850 const int numUnlocked = curdim-numNewLocked;
851 tmp_vector_int.resize(curdim);
852 for (
int i=0; i<curdim; i++) tmp_vector_int[i] = i;
853 const std::vector<int> curind(tmp_vector_int);
854 tmp_vector_int.resize(numUnlocked);
855 std::set_difference(curind.begin(),curind.end(),lockind.begin(),lockind.end(),tmp_vector_int.begin());
856 const std::vector<int> unlockind(tmp_vector_int);
857 tmp_vector_int.clear();
861 if (printer_->isVerbosity(
Debug)) {
862 printer_->print(
Debug,
"Locking vectors: ");
863 for (
unsigned int i=0; i<lockind.size(); i++) {printer_->stream(
Debug) <<
" " << lockind[i];}
864 printer_->print(
Debug,
"\n");
865 printer_->print(
Debug,
"Not locking vectors: ");
866 for (
unsigned int i=0; i<unlockind.size(); i++) {printer_->stream(
Debug) <<
" " << unlockind[i];}
867 printer_->print(
Debug,
"\n");
879 std::vector<MagnitudeType> theta(curdim);
882 int info = msutils::directSolver(curdim,*state.
KK,Teuchos::null,S,theta,rank,10);
883 TEUCHOS_TEST_FOR_EXCEPTION(info != 0 ,std::logic_error,
884 "Anasazi::BlockDavidsonSolMgr::solve(): error calling SolverUtils::directSolver.");
885 TEUCHOS_TEST_FOR_EXCEPTION(rank != curdim,std::logic_error,
886 "Anasazi::BlockDavidsonSolMgr::solve(): direct solve did not compute all eigenvectors.");
889 std::vector<int> order(curdim);
890 sorter->sort(theta,Teuchos::rcpFromRef(order),curdim);
893 msutils::permuteVectors(order,S);
900 for (
int i=0; i<numUnlocked; i++) {
901 blas.
COPY(curdim, S[unlockind[i]], 1, Su[i], 1);
915 if (inSituRestart_ ==
true) {
923 std::vector<ScalarType> tau(numUnlocked), work(numUnlocked);
925 lapack.
GEQRF(curdim,numUnlocked,copySu.values(),copySu.stride(),&tau[0],&work[0],work.size(),&info);
926 TEUCHOS_TEST_FOR_EXCEPTION(info != 0,std::logic_error,
927 "Anasazi::BlockDavidsonSolMgr::solve(): error calling GEQRF during restarting.");
928 if (printer_->isVerbosity(
Debug)) {
930 for (
int j=0; j<numUnlocked; j++) {
931 R(j,j) = SCT::magnitude(R(j,j)) - 1.0;
932 for (
int i=j+1; i<numUnlocked; i++) {
936 printer_->stream(
Debug) <<
"||Triangular factor of Su - I||: " << R.
normFrobenius() << std::endl;
944 msutils::applyHouse(numUnlocked,*oldV,copySu,tau,workMV);
946 std::vector<int> defind(numUnlocked), augind(numNewLocked);
947 for (
int i=0; i<numUnlocked ; i++) defind[i] = i;
948 for (
int i=0; i<numNewLocked; i++) augind[i] = numUnlocked+i;
949 defV = MVT::CloneViewNonConst(*solverbasis,defind);
950 augV = MVT::CloneViewNonConst(*solverbasis,augind);
954 std::vector<int> defind(numUnlocked), augind(numNewLocked);
955 for (
int i=0; i<numUnlocked ; i++) defind[i] = i;
956 for (
int i=0; i<numNewLocked; i++) augind[i] = numUnlocked+i;
958 defV = MVT::CloneViewNonConst(*workMV,defind);
959 augV = MVT::CloneViewNonConst(*workMV,augind);
961 MVT::MvTimesMatAddMv(ONE,*oldV,Su,ZERO,*defV);
979 if (curNumLocked > 0) {
980 std::vector<int> curlockind(curNumLocked);
981 for (
int i=0; i<curNumLocked; i++) curlockind[i] = i;
982 curlocked = MVT::CloneView(*lockvecs,curlockind);
985 curlocked = Teuchos::null;
988 std::vector<int> augtmpind(numNewLocked);
989 for (
int i=0; i<numNewLocked; i++) augtmpind[i] = curNumLocked+i;
990 augTmp = MVT::CloneViewNonConst(*lockvecs,augtmpind);
992 newLocked = MVT::CloneView(*bd_solver->getRitzVectors(),lockind);
998 MVT::MvRandom(*augV);
1005 if (probauxvecs != Teuchos::null) against.
push_back(probauxvecs);
1006 if (curlocked != Teuchos::null) against.
push_back(curlocked);
1009 if (problem_->getM() != Teuchos::null) {
1010 OPT::Apply(*problem_->getM(),*augV,*augTmp);
1012 ortho->projectAndNormalizeMat(*augV,against,dummyC,Teuchos::null,augTmp);
1031 TEUCHOS_TEST_FOR_EXCEPTION(teuchosRet != 0,std::logic_error,
1032 "Anasazi::BlockDavidsonSolMgr::solve(): Logic error calling SerialDenseMatrix::multiply.");
1035 TEUCHOS_TEST_FOR_EXCEPTION(teuchosRet != 0,std::logic_error,
1036 "Anasazi::BlockDavidsonSolMgr::solve(): Logic error calling SerialDenseMatrix::multiply.");
1041 OPT::Apply(*problem_->getOperator(),*augV,*augTmp);
1043 KK22(
Teuchos::View,newKK,numNewLocked,numNewLocked,numUnlocked,numUnlocked);
1044 MVT::MvTransMv(ONE,*defV,*augTmp,KK12);
1045 MVT::MvTransMv(ONE,*augV,*augTmp,KK22);
1049 defV = Teuchos::null;
1050 augV = Teuchos::null;
1053 for (
int j=0; j<curdim; ++j) {
1054 for (
int i=j+1; i<curdim; ++i) {
1055 newKK(i,j) = SCT::conjugate(newKK(j,i));
1061 augTmp = Teuchos::null;
1063 std::vector<Value<ScalarType> > allvals = bd_solver->getRitzValues();
1064 for (
int i=0; i<numNewLocked; i++) {
1065 lockvals.push_back(allvals[lockind[i]].realpart);
1068 std::vector<int> indlock(numNewLocked);
1069 for (
int i=0; i<numNewLocked; i++) indlock[i] = curNumLocked+i;
1070 MVT::SetBlock(*newLocked,indlock,*lockvecs);
1071 newLocked = Teuchos::null;
1073 curNumLocked += numNewLocked;
1074 std::vector<int> curlockind(curNumLocked);
1075 for (
int i=0; i<curNumLocked; i++) curlockind[i] = i;
1076 curlocked = MVT::CloneView(*lockvecs,curlockind);
1082 ordertest->setAuxVals(lockvals);
1085 if (probauxvecs != Teuchos::null) aux.
push_back(probauxvecs);
1087 bd_solver->setAuxVecs(aux);
1089 if (curNumLocked == maxLocked_) {
1091 combotest->removeTest(locktest);
1099 if (inSituRestart_) {
1107 rstate.
KK = Teuchos::rcpFromRef(newKK);
1110 bd_solver->initialize(rstate);
1119 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
"Anasazi::BlockDavidsonSolMgr::solve(): Invalid return from bd_solver::iterate().");
1124 <<
"Anasazi::BlockDavidsonSolMgr::solve() caught unexpected exception from Anasazi::BlockDavidson::iterate() at iteration " << bd_solver->getNumIters() << std::endl
1125 << err.what() << std::endl
1126 <<
"Anasazi::BlockDavidsonSolMgr::solve() returning Unconverged with no solutions." << std::endl;
1132 workMV = Teuchos::null;
1134 sol.
numVecs = ordertest->howMany();
1136 sol.
Evecs = MVT::Clone(*problem_->getInitVec(),sol.
numVecs);
1139 std::vector<MagnitudeType> vals(sol.
numVecs);
1142 std::vector<int> which = ordertest->whichVecs();
1146 std::vector<int> inlocked(0), insolver(0);
1147 for (
unsigned int i=0; i<which.size(); i++) {
1148 if (which[i] >= 0) {
1149 TEUCHOS_TEST_FOR_EXCEPTION(which[i] >= blockSize_,std::logic_error,
"Anasazi::BlockDavidsonSolMgr::solve(): positive indexing mistake from ordertest.");
1150 insolver.push_back(which[i]);
1154 TEUCHOS_TEST_FOR_EXCEPTION(which[i] < -curNumLocked,std::logic_error,
"Anasazi::BlockDavidsonSolMgr::solve(): negative indexing mistake from ordertest.");
1155 inlocked.push_back(which[i] + curNumLocked);
1159 TEUCHOS_TEST_FOR_EXCEPTION(insolver.size() + inlocked.size() != (
unsigned int)sol.
numVecs,std::logic_error,
"Anasazi::BlockDavidsonSolMgr::solve(): indexing mistake.");
1162 if (insolver.size() > 0) {
1164 int lclnum = insolver.size();
1165 std::vector<int> tosol(lclnum);
1166 for (
int i=0; i<lclnum; i++) tosol[i] = i;
1168 MVT::SetBlock(*v,tosol,*sol.
Evecs);
1170 std::vector<Value<ScalarType> > fromsolver = bd_solver->getRitzValues();
1171 for (
unsigned int i=0; i<insolver.size(); i++) {
1172 vals[i] = fromsolver[insolver[i]].realpart;
1177 if (inlocked.size() > 0) {
1178 int solnum = insolver.size();
1180 int lclnum = inlocked.size();
1181 std::vector<int> tosol(lclnum);
1182 for (
int i=0; i<lclnum; i++) tosol[i] = solnum + i;
1184 MVT::SetBlock(*v,tosol,*sol.
Evecs);
1186 for (
unsigned int i=0; i<inlocked.size(); i++) {
1187 vals[i+solnum] = lockvals[inlocked[i]];
1193 std::vector<int> order(sol.
numVecs);
1194 sorter->sort(vals,Teuchos::rcpFromRef(order),sol.
numVecs);
1196 for (
int i=0; i<sol.
numVecs; i++) {
1197 sol.
Evals[i].realpart = vals[i];
1198 sol.
Evals[i].imagpart = MT::zero();
1210 bd_solver->currentStatus(printer_->stream(
FinalSummary));
1213 #ifdef ANASAZI_TEUCHOS_TIME_MONITOR
1219 problem_->setSolution(sol);
1220 printer_->stream(
Debug) <<
"Returning " << sol.
numVecs <<
" eigenpairs to eigenproblem." << std::endl;
1223 numIters_ = bd_solver->getNumIters();
1232 template <
class ScalarType,
class MV,
class OP>
1237 globalTest_ = global;
1240 template <
class ScalarType,
class MV,
class OP>
1247 template <
class ScalarType,
class MV,
class OP>
1255 template <
class ScalarType,
class MV,
class OP>
1262 template <
class ScalarType,
class MV,
class OP>
1267 lockingTest_ = locking;
1270 template <
class ScalarType,
class MV,
class OP>
1274 return lockingTest_;
ScalarType * values() const
static ptrdiff_t GetGlobalLength(const MV &mv)
Return the number of rows in the given multivector mv.
Pure virtual base class which describes the basic interface for a solver manager. ...
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.
void setLockingStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &locking)
Set 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.
BlockDavidsonSolMgr(const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, Teuchos::ParameterList &pl)
Basic constructor for BlockDavidsonSolMgr.
This class defines the interface required by an eigensolver and status test class to compute solution...
Teuchos::RCP< const MV > R
The current residual vectors.
Teuchos::RCP< const Teuchos::SerialDenseMatrix< int, ScalarType > > KK
The current projected K matrix.
An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques...
SerialBandDenseMatrixPrinter< OrdinalType, ScalarType > printMat(const SerialBandDenseMatrix< OrdinalType, ScalarType > &obj)
basic_FancyOStream & setShowProcRank(const bool showProcRank)
T & get(const std::string &name, T def_value)
int multiply(ETransp transa, ETransp transb, ScalarType alpha, const SerialDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &B, ScalarType beta)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Virtual base class which defines basic traits for the operator type.
Teuchos::RCP< MV > Evecs
The computed eigenvectors.
Status test for forming logical combinations of other status tests.
Teuchos::RCP< const MV > KX
The image of the current eigenvectors under K.
The Anasazi::SolverManager is a templated virtual base class that defines the basic interface that an...
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getDebugStatusTest() const
Get the status test for debugging.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
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.
Output managers remove the need for the eigensolver to know any information about the required output...
This class implements a Block Davidson iteration, a preconditioned iteration for solving linear Hermi...
ScalarTraits< ScalarType >::magnitudeType normFrobenius() const
Implementation of the block Davidson method.
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.
bool isParameter(const std::string &name) const
int numVecs
The number of computed eigenpairs.
int getNumIters() const
Get the iteration count for the most recent call to solve().
void COPY(const OrdinalType &n, const ScalarType *x, const OrdinalType &incx, ScalarType *y, const OrdinalType &incy) const
Teuchos::RCP< MV > Espace
An orthonormal basis for the computed eigenspace.
Abstract class definition for Anasazi Output Managers.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Abstract base class which defines the interface required by an eigensolver and status test class to c...
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
ReturnType
Enumerated type used to pass back information from a solver manager.
Output managers remove the need for the eigensolver to know any information about the required output...
Teuchos::RCP< const MV > V
The basis for the Krylov space.
A status test for testing the norm of the eigenvectors residuals.
virtual ~BlockDavidsonSolMgr()
Destructor.
Traits class which defines basic operations on multivectors.
std::vector< int > index
An index into Evecs to allow compressed storage of eigenvectors for real, non-Hermitian problems...
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getLockingStatusTest() const
Get the status test defining locking.
basic_FancyOStream & setShowAllFrontMatter(const bool showAllFrontMatter)
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Orthogonalization manager based on the SVQB technique described in "A Block Orthogonalization Procedu...
Struct for storing an eigenproblem solution.
int curDim
The current dimension of the solver.
void push_back(const value_type &x)
void GEQRF(const OrdinalType &m, const OrdinalType &n, ScalarType *A, const OrdinalType &lda, ScalarType *TAU, ScalarType *WORK, const OrdinalType &lwork, OrdinalType *info) const
Structure to contain pointers to BlockDavidson state variables.
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > & getGlobalStatusTest() const
Get the status test defining global convergence.
Special StatusTest for printing status tests.
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
void setDebugStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &debug)
Set the status test for debugging.
Teuchos::RCP< const MV > X
The current eigenvectors.
Teuchos::RCP< const MV > MX
The image of the current eigenvectors under M, or Teuchos::null if M was not specified.
Status test for forming logical combinations of other status tests.
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using (potentially)...
Types and exceptions used within Anasazi solvers and interfaces.
Abstract class definition for Anasazi output stream.
The BlockDavidsonSolMgr provides a powerful solver manager over the BlockDavidson eigensolver...
Common interface of stopping criteria for Anasazi's solvers.
A status test for testing the norm of the eigenvectors residuals.
Basic implementation of the Anasazi::OrthoManager class.
void setGlobalStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &global)
Set the status test defining global convergence.
ReturnType solve()
This method performs possibly repeated calls to the underlying eigensolver's iterate() routine until ...
OrdinalType stride() const
const Eigenproblem< ScalarType, MV, OP > & getProblem() const
Return the eigenvalue problem.
Teuchos::RCP< const std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > > T
The current Ritz values. This vector is a copy of the internal data.
Class which provides internal utilities for the Anasazi solvers.