Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AnasaziGeneralizedDavidsonSolMgr.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Anasazi: Block Eigensolvers Package
5 // Copyright 2004 Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef ANASAZI_GENERALIZED_DAVIDSON_SOLMGR_HPP
43 #define ANASAZI_GENERALIZED_DAVIDSON_SOLMGR_HPP
44 
50 #include "Teuchos_RCPDecl.hpp"
51 
52 #include "AnasaziConfigDefs.hpp"
53 #include "AnasaziTypes.hpp"
54 #include "AnasaziEigenproblem.hpp"
55 #include "AnasaziSolverManager.hpp"
59 #include "AnasaziOutputManager.hpp"
61 #include "AnasaziBasicSort.hpp"
65 
66 using Teuchos::RCP;
67 
71 namespace Anasazi {
72 
91 template <class ScalarType, class MV, class OP>
92 class GeneralizedDavidsonSolMgr : public SolverManager<ScalarType,MV,OP>
93 {
94  public:
95 
129 
133  const Eigenproblem<ScalarType,MV,OP> & getProblem() const { return *d_problem; }
134 
138  int getNumIters() const { return d_solver->getNumIters(); }
139 
144  ReturnType solve();
145 
146  private:
147 
148  void getRestartState( GeneralizedDavidsonState<ScalarType,MV> &state );
149 
150  typedef MultiVecTraits<ScalarType,MV> MVT;
152  typedef typename ST::magnitudeType MagnitudeType;
154 
157  RCP< OutputManager<ScalarType> > d_outputMan;
161  int d_maxRestarts;
162  int d_restartDim;
163 
164 }; // class GeneralizedDavidsonSolMgr
165 
166 //---------------------------------------------------------------------------//
167 // Prevent instantiation on complex scalar type
168 //---------------------------------------------------------------------------//
169 template <class MagnitudeType, class MV, class OP>
170 class GeneralizedDavidsonSolMgr<std::complex<MagnitudeType>,MV,OP>
171 {
172  public:
173 
174  typedef std::complex<MagnitudeType> ScalarType;
176  const RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
178  {
179  // Provide a compile error when attempting to instantiate on complex type
180  MagnitudeType::this_class_is_missing_a_specialization();
181  }
182 };
183 
184 //---------------------------------------------------------------------------//
185 // Start member definitions
186 //---------------------------------------------------------------------------//
187 
188 //---------------------------------------------------------------------------//
189 // Constructor
190 //---------------------------------------------------------------------------//
191 template <class ScalarType, class MV, class OP>
193  const RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
195  : d_problem(problem)
196 {
197  TEUCHOS_TEST_FOR_EXCEPTION( d_problem == Teuchos::null, std::invalid_argument, "Problem not given to solver manager." );
198  TEUCHOS_TEST_FOR_EXCEPTION( !d_problem->isProblemSet(), std::invalid_argument, "Problem not set." );
199  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getA() == Teuchos::null &&
200  d_problem->getOperator() == Teuchos::null, std::invalid_argument, "A operator not supplied on Eigenproblem." );
201  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getInitVec() == Teuchos::null, std::invalid_argument, "No vector to clone from on Eigenproblem." );
202  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getNEV() <= 0, std::invalid_argument, "Number of requested eigenvalues must be positive.");
203 
204  if( !pl.isType<int>("Block Size") )
205  {
206  pl.set<int>("Block Size",1);
207  }
208 
209  if( !pl.isType<int>("Maximum Subspace Dimension") )
210  {
211  pl.set<int>("Maximum Subspace Dimension",3*problem->getNEV()*pl.get<int>("Block Size"));
212  }
213 
214  if( !pl.isType<int>("Print Number of Ritz Values") )
215  {
216  int numToPrint = std::max( pl.get<int>("Block Size"), d_problem->getNEV() );
217  pl.set<int>("Print Number of Ritz Values",numToPrint);
218  }
219 
220  // Get convergence info
221  MagnitudeType tol = pl.get<MagnitudeType>("Convergence Tolerance", MT::eps() );
222  TEUCHOS_TEST_FOR_EXCEPTION( pl.get<MagnitudeType>("Convergence Tolerance") <= MT::zero(),
223  std::invalid_argument, "Convergence Tolerance must be greater than zero." );
224 
225  // Get maximum restarts
226  if( pl.isType<int>("Maximum Restarts") )
227  {
228  d_maxRestarts = pl.get<int>("Maximum Restarts");
229  TEUCHOS_TEST_FOR_EXCEPTION( d_maxRestarts < 0, std::invalid_argument, "Maximum Restarts must be non-negative" );
230  }
231  else
232  {
233  d_maxRestarts = 20;
234  }
235 
236  // Get maximum restarts
237  d_restartDim = pl.get<int>("Restart Dimension",d_problem->getNEV());
238  TEUCHOS_TEST_FOR_EXCEPTION( d_restartDim < d_problem->getNEV(),
239  std::invalid_argument, "Restart Dimension must be at least NEV" );
240 
241  // Get initial guess type
242  std::string initType;
243  if( pl.isType<std::string>("Initial Guess") )
244  {
245  initType = pl.get<std::string>("Initial Guess");
246  TEUCHOS_TEST_FOR_EXCEPTION( initType!="User" && initType!="Random", std::invalid_argument,
247  "Initial Guess type must be 'User' or 'Random'." );
248  }
249  else
250  {
251  initType = "User";
252  }
253 
254  // Get sort type
255  std::string which;
256  if( pl.isType<std::string>("Which") )
257  {
258  which = pl.get<std::string>("Which");
259  TEUCHOS_TEST_FOR_EXCEPTION( which!="LM" && which!="SM" && which!="LR" && which!="SR" && which!="LI" && which!="SI",
260  std::invalid_argument,
261  "Which must be one of LM,SM,LR,SR,LI,SI." );
262  }
263  else
264  {
265  which = "LM";
266  }
267 
268  // Build sort manager (currently must be stored as pointer to derived class)
269  d_sortMan = Teuchos::rcp( new BasicSort<MagnitudeType>(which) );
270 
271  // Build orthogonalization manager
272  std::string ortho = pl.get<std::string>("Orthogonalization","SVQB");
273  TEUCHOS_TEST_FOR_EXCEPTION( ortho!="DGKS" && ortho!= "SVQB" && ortho!="ICGS", std::invalid_argument,
274  "Anasazi::GeneralizedDavidsonSolMgr::constructor: Invalid orthogonalization type" );
275 
276  if( ortho=="DGKS" )
277  {
279  }
280  else if( ortho=="SVQB" )
281  {
282  d_orthoMan = Teuchos::rcp( new SVQBOrthoManager<ScalarType,MV,OP>() );
283  }
284  else if( ortho=="ICGS" )
285  {
286  d_orthoMan = Teuchos::rcp( new ICGSOrthoManager<ScalarType,MV,OP>() );
287  }
288 
289  // Build StatusTest
290  bool scaleRes = false; // Always false, scaling the residual is handled by the solver
291  bool failOnNaN = false;
293  new StatusTestResNorm<ScalarType,MV,OP>(tol,d_problem->getNEV(),
294  RES_2NORM,scaleRes,failOnNaN) );
295  d_tester = Teuchos::rcp( new StatusTestWithOrdering<ScalarType,MV,OP>(resNormTest,d_sortMan,d_problem->getNEV()) );
296 
297  // Build output manager
298 
299  // Create a formatted output stream to print to.
300  // See if user requests output processor.
301  int osProc = pl.get("Output Processor", 0);
302 
303  // If not passed in by user, it will be chosen based upon operator type.
305 
306  if (pl.isParameter("Output Stream")) {
307  osp = Teuchos::getParameter<Teuchos::RCP<Teuchos::FancyOStream> >(pl,"Output Stream");
308  }
309  else {
310  osp = OutputStreamTraits<OP>::getOutputStream (*d_problem->getOperator(), osProc);
311  }
312 
313  // verbosity
314  int verbosity = Anasazi::Errors;
315  if (pl.isParameter("Verbosity")) {
316  if (Teuchos::isParameterType<int>(pl,"Verbosity")) {
317  verbosity = pl.get("Verbosity", verbosity);
318  } else {
319  verbosity = (int)Teuchos::getParameter<Anasazi::MsgType>(pl,"Verbosity");
320  }
321  }
322 
323  d_outputMan = Teuchos::rcp( new OutputManager<ScalarType>(verbosity,osp) );
324 
325  // Build solver
326  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: Building solver" << std::endl;
327  d_solver = Teuchos::rcp( new GeneralizedDavidson<ScalarType,MV,OP>( problem, d_sortMan, d_outputMan, d_tester, d_orthoMan, pl ) );
328 
329  TEUCHOS_TEST_FOR_EXCEPTION(d_solver->getMaxSubspaceDim() < d_restartDim, std::invalid_argument,
330  "The maximum size of the subspace dimension (" << d_solver->getMaxSubspaceDim() << ") must "
331  "not be smaller than the size of the restart space (" << d_restartDim << "). "
332  "Please adjust \"Restart Dimension\" and/or \"Maximum Subspace Dimension\" parameters.");
333 
334 }
335 
336 //---------------------------------------------------------------------------//
337 // Solve
338 //---------------------------------------------------------------------------//
339 template <class ScalarType, class MV, class OP>
341 {
343  sol.numVecs = 0;
344  d_problem->setSolution(sol);
345 
346  d_solver->initialize();
347  int restarts = 0;
348  while( 1 )
349  {
350  // Call iterate on the solver
351  d_solver->iterate();
352 
353  // If the solver converged, we're done
354  if( d_tester->getStatus() == Passed )
355  break;
356 
357  // If we're already at maximum number of restarts, wrap it up
358  if( restarts == d_maxRestarts )
359  break;
360 
361  // We need to restart
362  d_solver->sortProblem( d_restartDim );
363  GeneralizedDavidsonState<ScalarType,MV> state = d_solver->getState();
364  getRestartState( state );
365  d_solver->initialize( state );
366  restarts++;
367  }
368 
369  // Output final state
370  if( d_outputMan->isVerbosity(FinalSummary) )
371  d_solver->currentStatus(d_outputMan->stream(FinalSummary));
372 
373  // Fill solution struct
374  sol.numVecs = d_tester->howMany();
375  if( sol.numVecs > 0 )
376  {
377  std::vector<int> whichVecs = d_tester->whichVecs();
378  std::vector<int> origIndex = d_solver->getRitzIndex();
379 
380  // Make sure no conjugate pairs are split
381  // Because these are not sorted we have to check all values
382  for( int i=0; i<sol.numVecs; ++i )
383  {
384  if( origIndex[ whichVecs[i] ] == 1 )
385  {
386  if( std::find( whichVecs.begin(), whichVecs.end(), whichVecs[i]+1 ) == whichVecs.end() )
387  {
388  whichVecs.push_back( whichVecs[i]+1 );
389  sol.numVecs++;
390  }
391  }
392  else if( origIndex[ whichVecs[i] ] == -1 )
393  {
394  if( std::find( whichVecs.begin(), whichVecs.end(), whichVecs[i]-1 ) == whichVecs.end() )
395  {
396  whichVecs.push_back( whichVecs[i]-1 );
397  sol.numVecs++;
398  }
399  }
400  }
401 
402  if( d_outputMan->isVerbosity(Debug) )
403  {
404  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: "
405  << sol.numVecs << " eigenpairs converged" << std::endl;
406  }
407 
408  // Sort converged values
409  std::vector< Value<ScalarType> > origVals = d_solver->getRitzValues();
410  std::vector<MagnitudeType> realParts;
411  std::vector<MagnitudeType> imagParts;
412  for( int i=0; i<sol.numVecs; ++i )
413  {
414  realParts.push_back( origVals[whichVecs[i]].realpart );
415  imagParts.push_back( origVals[whichVecs[i]].imagpart );
416  }
417 
418  std::vector<int> permVec(sol.numVecs);
419  d_sortMan->sort( realParts, imagParts, Teuchos::rcpFromRef(permVec), sol.numVecs );
420 
421  // Create new which vector
422  std::vector<int> newWhich;
423  for( int i=0; i<sol.numVecs; ++i )
424  newWhich.push_back( whichVecs[permVec[i]] );
425 
426  // Check if converged vectors are ordered
427  bool ordered = true;
428  for( int i=0; i<sol.numVecs; ++i )
429  {
430  if( newWhich[i]!=i )
431  {
432  ordered = false;
433  break;
434  }
435  }
436 
437  if( ordered )
438  {
439  // Everything is ordered, pull directly from solver and resize
440  sol.index = origIndex;
441  sol.index.resize(sol.numVecs);
442  sol.Evals = d_solver->getRitzValues();
443  sol.Evals.resize(sol.numVecs);
444  }
445  else
446  {
447  // Manually copy values into sol
448 
449  sol.index.resize(sol.numVecs);
450  sol.Evals.resize(sol.numVecs);
451 
452  for( int i=0; i<sol.numVecs; ++i )
453  {
454  sol.index[i] = origIndex[ newWhich[i] ];
455  sol.Evals[i] = origVals[ newWhich[i] ];
456  }
457  }
458  sol.Evecs = MVT::CloneCopy( *(d_solver->getRitzVectors()), newWhich );
459  }
460  d_problem->setSolution(sol);
461 
462  // Return convergence status
463  if( sol.numVecs < d_problem->getNEV() )
464  return Unconverged;
465 
466  return Converged;
467 }
468 
469 //---------------------------------------------------------------------------//
470 // Update GeneralizedDavidson state for restarting
471 //---------------------------------------------------------------------------//
472 template <class ScalarType, class MV, class OP>
475 {
476  TEUCHOS_TEST_FOR_EXCEPTION( state.curDim <= d_restartDim, std::runtime_error,
477  "Anasazi::GeneralizedDavidsonSolMgr: State dimension at restart is smaller than Restart Dimension" );
478 
479  std::vector<int> ritzIndex = d_solver->getRitzIndex();
480 
481  // Don't split conjugate pair when restarting
482  int restartDim = d_restartDim;
483  if( ritzIndex[d_restartDim-1]==1 )
484  restartDim++;
485 
486  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: Restarting with "
487  << restartDim << " vectors" << std::endl;
488 
489  // We have already sorted the problem with d_restartDim "best" values
490  // in the leading position. If we partition the Schur vectors (Z)
491  // of the projected problem as Z = [Z_wanted Z_unwanted], then the
492  // search subspace after the restart is V_restart = V*Z_wanted
493  // (same for AV,BV)
494 
495  // Get view of wanted portion of Z
498 
499  // Get indices for restart
500  std::vector<int> allIndices(state.curDim);
501  for( int i=0; i<state.curDim; ++i )
502  allIndices[i] = i;
503 
504  RCP<const MV> V_orig = MVT::CloneView( *state.V, allIndices );
505 
506  // Get indices for restart
507  std::vector<int> restartIndices(restartDim);
508  for( int i=0; i<restartDim; ++i )
509  restartIndices[i] = i;
510 
511  // Views of subspace vectors to be updated
512  RCP<MV> V_restart = MVT::CloneViewNonConst( *state.V, restartIndices );
513 
514  // Temp storage
515  RCP<MV> restartVecs = MVT::Clone(*state.V,restartDim);
516 
517  // Reset V
518  MVT::MvTimesMatAddMv(ST::one(),*V_orig,Z_wanted,ST::zero(),*restartVecs);
519  MVT::SetBlock(*restartVecs,restartIndices,*V_restart);
520 
521  // V, Z each have orthonormal columns, therefore V*Z should as well
522  if( d_outputMan->isVerbosity(Debug) )
523  {
524  MagnitudeType orthErr = d_orthoMan->orthonormError(*V_restart);
525  std::stringstream os;
526  os << " >> Anasazi::GeneralizedDavidsonSolMgr: Error in V^T V == I after restart : " << orthErr << std::endl;
527  d_outputMan->print(Debug,os.str());
528  }
529 
530  // Reset AV
531  RCP<MV> AV_restart = MVT::CloneViewNonConst( *state.AV, restartIndices );
532  RCP<const MV> AV_orig = MVT::CloneView( *state.AV, allIndices );
533 
534  MVT::MvTimesMatAddMv(ST::one(),*AV_orig,Z_wanted,ST::zero(),*restartVecs);
535  MVT::SetBlock(*restartVecs,restartIndices,*AV_restart);
536 
537  int err;
538 
539  // Update matrix projection as Z^{*}(V^{*}AV)Z
540  const Teuchos::SerialDenseMatrix<int,ScalarType> VAV_orig( Teuchos::View, *state.VAV, state.curDim, state.curDim );
541  Teuchos::SerialDenseMatrix<int,ScalarType> tmpMat(state.curDim, restartDim);
542  err = tmpMat.multiply( Teuchos::NO_TRANS, Teuchos::NO_TRANS, ST::one(), VAV_orig, Z_wanted, ST::zero() );
543  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
544 
545  Teuchos::SerialDenseMatrix<int,ScalarType> VAV_restart( Teuchos::View, *state.VAV, restartDim, restartDim );
546  err = VAV_restart.multiply( Teuchos::TRANS, Teuchos::NO_TRANS, ST::one(), Z_wanted, tmpMat, ST::zero() );
547  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
548 
549  if( d_problem->getM() != Teuchos::null )
550  {
551  // Reset BV
552  RCP<const MV> BV_orig = MVT::CloneView( *state.BV, allIndices );
553  RCP<MV> BV_restart = MVT::CloneViewNonConst( *state.BV, restartIndices );
554 
555  MVT::MvTimesMatAddMv(ST::one(),*BV_orig,Z_wanted,ST::zero(),*restartVecs);
556  MVT::SetBlock(*restartVecs,restartIndices,*BV_restart);
557 
558 
559  // Update matrix projection as Z^{*}(V^{*}BV)Z
560  const Teuchos::SerialDenseMatrix<int,ScalarType> VBV_orig( Teuchos::View, *state.VBV, state.curDim, state.curDim );
561  err = tmpMat.multiply( Teuchos::NO_TRANS, Teuchos::NO_TRANS, ST::one(), VBV_orig, Z_wanted, ST::zero() );
562  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
563 
564  Teuchos::SerialDenseMatrix<int,ScalarType> VBV_restart( Teuchos::View, *state.VBV, restartDim, restartDim );
565  VBV_restart.multiply( Teuchos::TRANS, Teuchos::NO_TRANS, ST::one(), Z_wanted, tmpMat, ST::zero() );
566  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
567  }
568 
569  // Set Q,Z to identity
570  state.Q->putScalar( ST::zero() );
571  state.Z->putScalar( ST::zero() );
572  for( int ii=0; ii<restartDim; ii++ )
573  {
574  (*state.Q)(ii,ii)= ST::one();
575  (*state.Z)(ii,ii)= ST::one();
576  }
577 
578  // Update current dimension
579  state.curDim = restartDim;
580 }
581 
582 } // namespace Anasazi
583 
584 #endif // ANASAZI_GENERALIZED_DAVIDSON_SOLMGR_HPP
585 
ReturnType solve()
This method performs possibly repeated calls to the underlying eigensolver&#39;s iterate() routine until ...
Pure virtual base class which describes the basic interface for a solver manager. ...
RCP< MV > V
Orthonormal basis for search subspace.
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.
This class defines the interface required by an eigensolver and status test class to compute solution...
static magnitudeType eps()
An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques...
Solves eigenvalue problem using generalized Davidson method.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< MV > Evecs
The computed eigenvectors.
RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > VAV
Projection of A onto V.
An implementation of the Anasazi::GenOrthoManager that performs orthogonalization using iterated clas...
The Anasazi::SolverManager is a templated virtual base class that defines the basic interface that an...
int curDim
The current subspace dimension.
Basic implementation of the Anasazi::SortManager class.
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using the SVQB iter...
Output managers remove the need for the eigensolver to know any information about the required output...
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
Structure to contain pointers to GeneralizedDavidson state variables.
bool isParameter(const std::string &name) const
int numVecs
The number of computed eigenpairs.
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...
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...
A status test for testing the norm of the eigenvectors residuals.
RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > Q
Left generalized Schur vectors from QZ decomposition of (VAV,VBV)
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...
int getNumIters() const
Get the iteration count for the most recent call to solve()
const Eigenproblem< ScalarType, MV, OP > & getProblem() const
Return the eigenvalue problem.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Orthogonalization manager based on the SVQB technique described in &quot;A Block Orthogonalization Procedu...
Struct for storing an eigenproblem solution.
GeneralizedDavidsonSolMgr(const RCP< Eigenproblem< ScalarType, MV, OP > > &problem, Teuchos::ParameterList &pl)
Basic constructor for GeneralizedDavidsonSolMgr.
RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > VBV
Projection of B onto V.
RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > Z
Right generalized Schur vectors from QZ decomposition of (VAV,VBV)
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using (potentially)...
Types and exceptions used within Anasazi solvers and interfaces.
bool isType(const std::string &name) const
Abstract class definition for Anasazi output stream.
Solver Manager for GeneralizedDavidson.
A status test for testing the norm of the eigenvectors residuals.
Basic implementation of the Anasazi::OrthoManager class.
Basic implementation of the Anasazi::OrthoManager class.
Implementation of a block Generalized Davidson eigensolver.