Anasazi  Version of the Day
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 
49 #include "Teuchos_ParameterList.hpp"
50 #include "Teuchos_RCPDecl.hpp"
51 
52 #include "AnasaziConfigDefs.hpp"
53 #include "AnasaziTypes.hpp"
54 #include "AnasaziEigenproblem.hpp"
55 #include "AnasaziSolverManager.hpp"
60 #include "AnasaziBasicSort.hpp"
64 
65 using Teuchos::RCP;
66 
70 namespace Anasazi {
71 
90 template <class ScalarType, class MV, class OP>
91 class GeneralizedDavidsonSolMgr : public SolverManager<ScalarType,MV,OP>
92 {
93  public:
94 
124  Teuchos::ParameterList &pl );
125 
129  const Eigenproblem<ScalarType,MV,OP> & getProblem() const { return *d_problem; }
130 
134  int getNumIters() const { return d_solver->getNumIters(); }
135 
140  ReturnType solve();
141 
142  private:
143 
144  void getRestartState( GeneralizedDavidsonState<ScalarType,MV> &state );
145 
147  typedef Teuchos::ScalarTraits<ScalarType> ST;
148  typedef typename ST::magnitudeType MagnitudeType;
149  typedef Teuchos::ScalarTraits<MagnitudeType> MT;
150 
151  RCP< Eigenproblem<ScalarType,MV,OP> > d_problem;
152  RCP< GeneralizedDavidson<ScalarType,MV,OP> > d_solver;
153  RCP< OutputManager<ScalarType> > d_outputMan;
154  RCP< OrthoManager<ScalarType,MV> > d_orthoMan;
155  RCP< SortManager<MagnitudeType> > d_sortMan;
156  RCP< StatusTest<ScalarType,MV,OP> > d_tester;
157  int d_maxRestarts;
158  int d_restartDim;
159 
160 }; // class GeneralizedDavidsonSolMgr
161 
162 //---------------------------------------------------------------------------//
163 // Prevent instantiation on complex scalar type
164 //---------------------------------------------------------------------------//
165 template <class MagnitudeType, class MV, class OP>
166 class GeneralizedDavidsonSolMgr<std::complex<MagnitudeType>,MV,OP>
167 {
168  public:
169 
170  typedef std::complex<MagnitudeType> ScalarType;
172  const RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
173  Teuchos::ParameterList &pl )
174  {
175  // Provide a compile error when attempting to instantiate on complex type
176  MagnitudeType::this_class_is_missing_a_specialization();
177  }
178 };
179 
180 //---------------------------------------------------------------------------//
181 // Start member definitions
182 //---------------------------------------------------------------------------//
183 
184 //---------------------------------------------------------------------------//
185 // Constructor
186 //---------------------------------------------------------------------------//
187 template <class ScalarType, class MV, class OP>
189  const RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
190  Teuchos::ParameterList &pl )
191  : d_problem(problem)
192 {
193  TEUCHOS_TEST_FOR_EXCEPTION( d_problem == Teuchos::null, std::invalid_argument, "Problem not given to solver manager." );
194  TEUCHOS_TEST_FOR_EXCEPTION( !d_problem->isProblemSet(), std::invalid_argument, "Problem not set." );
195  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getA() == Teuchos::null &&
196  d_problem->getOperator() == Teuchos::null, std::invalid_argument, "A operator not supplied on Eigenproblem." );
197  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getInitVec() == Teuchos::null, std::invalid_argument, "No vector to clone from on Eigenproblem." );
198  TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getNEV() <= 0, std::invalid_argument, "Number of requested eigenvalues must be positive.");
199 
200  if( !pl.isType<int>("Block Size") )
201  {
202  pl.set<int>("Block Size",1);
203  }
204 
205  if( !pl.isType<int>("Maximum Subspace Dimension") )
206  {
207  pl.set<int>("Maximum Subspace Dimension",3*problem->getNEV()*pl.get<int>("Block Size"));
208  }
209 
210  if( !pl.isType<int>("Print Number of Ritz Values") )
211  {
212  int numToPrint = std::max( pl.get<int>("Block Size"), d_problem->getNEV() );
213  pl.set<int>("Print Number of Ritz Values",numToPrint);
214  }
215 
216  // Get convergence info
217  MagnitudeType tol = pl.get<MagnitudeType>("Convergence Tolerance", MT::eps() );
218  TEUCHOS_TEST_FOR_EXCEPTION( pl.get<MagnitudeType>("Convergence Tolerance") <= MT::zero(),
219  std::invalid_argument, "Convergence Tolerance must be greater than zero." );
220 
221  // Get maximum restarts
222  if( pl.isType<int>("Maximum Restarts") )
223  {
224  d_maxRestarts = pl.get<int>("Maximum Restarts");
225  TEUCHOS_TEST_FOR_EXCEPTION( d_maxRestarts < 0, std::invalid_argument, "Maximum Restarts must be non-negative" );
226  }
227  else
228  {
229  d_maxRestarts = 20;
230  }
231 
232  // Get maximum restarts
233  d_restartDim = pl.get<int>("Restart Dimension",d_problem->getNEV());
234  TEUCHOS_TEST_FOR_EXCEPTION( d_restartDim < d_problem->getNEV(),
235  std::invalid_argument, "Restart Dimension must be at least NEV" );
236 
237  // Get initial guess type
238  std::string initType;
239  if( pl.isType<std::string>("Initial Guess") )
240  {
241  initType = pl.get<std::string>("Initial Guess");
242  TEUCHOS_TEST_FOR_EXCEPTION( initType!="User" && initType!="Random", std::invalid_argument,
243  "Initial Guess type must be 'User' or 'Random'." );
244  }
245  else
246  {
247  initType = "User";
248  }
249 
250  // Get sort type
251  std::string which;
252  if( pl.isType<std::string>("Which") )
253  {
254  which = pl.get<std::string>("Which");
255  TEUCHOS_TEST_FOR_EXCEPTION( which!="LM" && which!="SM" && which!="LR" && which!="SR" && which!="LI" && which!="SI",
256  std::invalid_argument,
257  "Which must be one of LM,SM,LR,SR,LI,SI." );
258  }
259  else
260  {
261  which = "LM";
262  }
263 
264  // Build sort manager (currently must be stored as pointer to derived class)
265  d_sortMan = Teuchos::rcp( new BasicSort<MagnitudeType>(which) );
266 
267  // Build orthogonalization manager
268  std::string ortho = pl.get<std::string>("Orthogonalization","SVQB");
269  TEUCHOS_TEST_FOR_EXCEPTION( ortho!="DGKS" && ortho!= "SVQB" && ortho!="ICGS", std::invalid_argument,
270  "Anasazi::GeneralizedDavidsonSolMgr::constructor: Invalid orthogonalization type" );
271 
272  if( ortho=="DGKS" )
273  {
274  d_orthoMan = Teuchos::rcp( new BasicOrthoManager<ScalarType,MV,OP>() );
275  }
276  else if( ortho=="SVQB" )
277  {
278  d_orthoMan = Teuchos::rcp( new SVQBOrthoManager<ScalarType,MV,OP>() );
279  }
280  else if( ortho=="ICGS" )
281  {
282  d_orthoMan = Teuchos::rcp( new ICGSOrthoManager<ScalarType,MV,OP>() );
283  }
284 
285  // Build StatusTest
286  bool scaleRes = false; // Always false, scaling the residual is handled by the solver
287  bool failOnNaN = false;
288  RCP<StatusTest<ScalarType,MV,OP> > resNormTest = Teuchos::rcp(
289  new StatusTestResNorm<ScalarType,MV,OP>(tol,d_problem->getNEV(),
290  RES_2NORM,scaleRes,failOnNaN) );
291  d_tester = Teuchos::rcp( new StatusTestWithOrdering<ScalarType,MV,OP>(resNormTest,d_sortMan,d_problem->getNEV()) );
292 
293  // Build output manager
294  int verbosity = pl.get<int>("Verbosity",Errors);
295  d_outputMan = Teuchos::rcp( new BasicOutputManager<ScalarType>() );
296  d_outputMan->setVerbosity( verbosity );
297 
298  // Build solver
299  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: Building solver" << std::endl;
300  d_solver = Teuchos::rcp( new GeneralizedDavidson<ScalarType,MV,OP>( problem, d_sortMan, d_outputMan, d_tester, d_orthoMan, pl ) );
301 
302  TEUCHOS_TEST_FOR_EXCEPTION(d_solver->getMaxSubspaceDim() < d_restartDim, std::invalid_argument,
303  "The maximum size of the subspace dimension (" << d_solver->getMaxSubspaceDim() << ") must "
304  "not be smaller than the size of the restart space (" << d_restartDim << "). "
305  "Please adjust \"Restart Dimension\" and/or \"Maximum Subspace Dimension\" parameters.");
306 
307 }
308 
309 //---------------------------------------------------------------------------//
310 // Solve
311 //---------------------------------------------------------------------------//
312 template <class ScalarType, class MV, class OP>
314 {
316  sol.numVecs = 0;
317  d_problem->setSolution(sol);
318 
319  d_solver->initialize();
320  int restarts = 0;
321  while( 1 )
322  {
323  // Call iterate on the solver
324  d_solver->iterate();
325 
326  // If the solver converged, we're done
327  if( d_tester->getStatus() == Passed )
328  break;
329 
330  // If we're already at maximum number of restarts, wrap it up
331  if( restarts == d_maxRestarts )
332  break;
333 
334  // We need to restart
335  d_solver->sortProblem( d_restartDim );
336  GeneralizedDavidsonState<ScalarType,MV> state = d_solver->getState();
337  getRestartState( state );
338  d_solver->initialize( state );
339  restarts++;
340  }
341 
342  // Output final state
343  if( d_outputMan->isVerbosity(FinalSummary) )
344  d_solver->currentStatus(d_outputMan->stream(FinalSummary));
345 
346  // Fill solution struct
347  sol.numVecs = d_tester->howMany();
348  if( sol.numVecs > 0 )
349  {
350  std::vector<int> whichVecs = d_tester->whichVecs();
351  std::vector<int> origIndex = d_solver->getRitzIndex();
352 
353  // Make sure no conjugate pairs are split
354  // Because these are not sorted we have to check all values
355  for( int i=0; i<sol.numVecs; ++i )
356  {
357  if( origIndex[ whichVecs[i] ] == 1 )
358  {
359  if( std::find( whichVecs.begin(), whichVecs.end(), whichVecs[i]+1 ) == whichVecs.end() )
360  {
361  whichVecs.push_back( whichVecs[i]+1 );
362  sol.numVecs++;
363  }
364  }
365  else if( origIndex[ whichVecs[i] ] == -1 )
366  {
367  if( std::find( whichVecs.begin(), whichVecs.end(), whichVecs[i]-1 ) == whichVecs.end() )
368  {
369  whichVecs.push_back( whichVecs[i]-1 );
370  sol.numVecs++;
371  }
372  }
373  }
374 
375  if( d_outputMan->isVerbosity(Debug) )
376  {
377  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: "
378  << sol.numVecs << " eigenpairs converged" << std::endl;
379  }
380 
381  // Sort converged values
382  std::vector< Value<ScalarType> > origVals = d_solver->getRitzValues();
383  std::vector<MagnitudeType> realParts;
384  std::vector<MagnitudeType> imagParts;
385  for( int i=0; i<sol.numVecs; ++i )
386  {
387  realParts.push_back( origVals[whichVecs[i]].realpart );
388  imagParts.push_back( origVals[whichVecs[i]].imagpart );
389  }
390 
391  std::vector<int> permVec(sol.numVecs);
392  d_sortMan->sort( realParts, imagParts, Teuchos::rcpFromRef(permVec), sol.numVecs );
393 
394  // Create new which vector
395  std::vector<int> newWhich;
396  for( int i=0; i<sol.numVecs; ++i )
397  newWhich.push_back( whichVecs[permVec[i]] );
398 
399  // Check if converged vectors are ordered
400  bool ordered = true;
401  for( int i=0; i<sol.numVecs; ++i )
402  {
403  if( newWhich[i]!=i )
404  {
405  ordered = false;
406  break;
407  }
408  }
409 
410  if( ordered )
411  {
412  // Everything is ordered, pull directly from solver and resize
413  sol.index = origIndex;
414  sol.index.resize(sol.numVecs);
415  sol.Evals = d_solver->getRitzValues();
416  sol.Evals.resize(sol.numVecs);
417  }
418  else
419  {
420  // Manually copy values into sol
421 
422  sol.index.resize(sol.numVecs);
423  sol.Evals.resize(sol.numVecs);
424 
425  for( int i=0; i<sol.numVecs; ++i )
426  {
427  sol.index[i] = origIndex[ newWhich[i] ];
428  sol.Evals[i] = origVals[ newWhich[i] ];
429  }
430  }
431  sol.Evecs = MVT::CloneCopy( *(d_solver->getRitzVectors()), newWhich );
432  }
433  d_problem->setSolution(sol);
434 
435  // Return convergence status
436  if( sol.numVecs < d_problem->getNEV() )
437  return Unconverged;
438 
439  return Converged;
440 }
441 
442 //---------------------------------------------------------------------------//
443 // Update GeneralizedDavidson state for restarting
444 //---------------------------------------------------------------------------//
445 template <class ScalarType, class MV, class OP>
448 {
449  TEUCHOS_TEST_FOR_EXCEPTION( state.curDim <= d_restartDim, std::runtime_error,
450  "Anasazi::GeneralizedDavidsonSolMgr: State dimension at restart is smaller than Restart Dimension" );
451 
452  std::vector<int> ritzIndex = d_solver->getRitzIndex();
453 
454  // Don't split conjugate pair when restarting
455  int restartDim = d_restartDim;
456  if( ritzIndex[d_restartDim-1]==1 )
457  restartDim++;
458 
459  d_outputMan->stream(Debug) << " >> Anasazi::GeneralizedDavidsonSolMgr: Restarting with "
460  << restartDim << " vectors" << std::endl;
461 
462  // We have already sorted the problem with d_restartDim "best" values
463  // in the leading position. If we partition the Schur vectors (Z)
464  // of the projected problem as Z = [Z_wanted Z_unwanted], then the
465  // search subspace after the restart is V_restart = V*Z_wanted
466  // (same for AV,BV)
467 
468  // Get view of wanted portion of Z
469  const Teuchos::SerialDenseMatrix<int,ScalarType> Z_wanted =
470  Teuchos::SerialDenseMatrix<int,ScalarType>(Teuchos::View,*state.Z,state.curDim,restartDim);
471 
472  // Get indices for restart
473  std::vector<int> allIndices(state.curDim);
474  for( int i=0; i<state.curDim; ++i )
475  allIndices[i] = i;
476 
477  RCP<const MV> V_orig = MVT::CloneView( *state.V, allIndices );
478 
479  // Get indices for restart
480  std::vector<int> restartIndices(restartDim);
481  for( int i=0; i<restartDim; ++i )
482  restartIndices[i] = i;
483 
484  // Views of subspace vectors to be updated
485  RCP<MV> V_restart = MVT::CloneViewNonConst( *state.V, restartIndices );
486 
487  // Temp storage
488  RCP<MV> restartVecs = MVT::Clone(*state.V,restartDim);
489 
490  // Reset V
491  MVT::MvTimesMatAddMv(ST::one(),*V_orig,Z_wanted,ST::zero(),*restartVecs);
492  MVT::SetBlock(*restartVecs,restartIndices,*V_restart);
493 
494  // V, Z each have orthonormal columns, therefore V*Z should as well
495  if( d_outputMan->isVerbosity(Debug) )
496  {
497  MagnitudeType orthErr = d_orthoMan->orthonormError(*V_restart);
498  std::stringstream os;
499  os << " >> Anasazi::GeneralizedDavidsonSolMgr: Error in V^T V == I after restart : " << orthErr << std::endl;
500  d_outputMan->print(Debug,os.str());
501  }
502 
503  // Reset AV
504  RCP<MV> AV_restart = MVT::CloneViewNonConst( *state.AV, restartIndices );
505  RCP<const MV> AV_orig = MVT::CloneView( *state.AV, allIndices );
506 
507  MVT::MvTimesMatAddMv(ST::one(),*AV_orig,Z_wanted,ST::zero(),*restartVecs);
508  MVT::SetBlock(*restartVecs,restartIndices,*AV_restart);
509 
510  int err;
511 
512  // Update matrix projection as Z^{*}(V^{*}AV)Z
513  const Teuchos::SerialDenseMatrix<int,ScalarType> VAV_orig( Teuchos::View, *state.VAV, state.curDim, state.curDim );
514  Teuchos::SerialDenseMatrix<int,ScalarType> tmpMat(state.curDim, restartDim);
515  err = tmpMat.multiply( Teuchos::NO_TRANS, Teuchos::NO_TRANS, ST::one(), VAV_orig, Z_wanted, ST::zero() );
516  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
517 
518  Teuchos::SerialDenseMatrix<int,ScalarType> VAV_restart( Teuchos::View, *state.VAV, restartDim, restartDim );
519  err = VAV_restart.multiply( Teuchos::TRANS, Teuchos::NO_TRANS, ST::one(), Z_wanted, tmpMat, ST::zero() );
520  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
521 
522  if( d_problem->getM() != Teuchos::null )
523  {
524  // Reset BV
525  RCP<const MV> BV_orig = MVT::CloneView( *state.BV, allIndices );
526  RCP<MV> BV_restart = MVT::CloneViewNonConst( *state.BV, restartIndices );
527 
528  MVT::MvTimesMatAddMv(ST::one(),*BV_orig,Z_wanted,ST::zero(),*restartVecs);
529  MVT::SetBlock(*restartVecs,restartIndices,*BV_restart);
530 
531 
532  // Update matrix projection as Z^{*}(V^{*}BV)Z
533  const Teuchos::SerialDenseMatrix<int,ScalarType> VBV_orig( Teuchos::View, *state.VBV, state.curDim, state.curDim );
534  err = tmpMat.multiply( Teuchos::NO_TRANS, Teuchos::NO_TRANS, ST::one(), VBV_orig, Z_wanted, ST::zero() );
535  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
536 
537  Teuchos::SerialDenseMatrix<int,ScalarType> VBV_restart( Teuchos::View, *state.VBV, restartDim, restartDim );
538  VBV_restart.multiply( Teuchos::TRANS, Teuchos::NO_TRANS, ST::one(), Z_wanted, tmpMat, ST::zero() );
539  TEUCHOS_TEST_FOR_EXCEPTION( err!=0, std::runtime_error, "GeneralizedDavidsonSolMgr::getRestartState: multiply returned nonzero error code" );
540  }
541 
542  // Set Q,Z to identity
543  state.Q->putScalar( ST::zero() );
544  state.Z->putScalar( ST::zero() );
545  for( int ii=0; ii<restartDim; ii++ )
546  {
547  (*state.Q)(ii,ii)= ST::one();
548  (*state.Z)(ii,ii)= ST::one();
549  }
550 
551  // Update current dimension
552  state.curDim = restartDim;
553 }
554 
555 } // namespace Anasazi
556 
557 #endif // ANASAZI_GENERALIZED_DAVIDSON_SOLMGR_HPP
558 
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.
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, ScalarType > &B, const ScalarType beta, MV &mv)
Update mv with .
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.
This class defines the interface required by an eigensolver and status test class to compute solution...
An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques...
Solves eigenvalue problem using generalized Davidson method.
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.
const Eigenproblem< ScalarType, MV, OP > & getProblem() const
Return the eigenvalue problem.
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using the SVQB iter...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
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.
int numVecs
The number of computed eigenpairs.
Basic output manager for sending information of select verbosity levels to the appropriate output str...
Anasazi&#39;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.
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.
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
std::vector< int > index
An index into Evecs to allow compressed storage of eigenvectors for real, non-Hermitian problems...
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...
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.
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...
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.
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.
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
Implementation of a block Generalized Davidson eigensolver.
int getNumIters() const
Get the iteration count for the most recent call to solve()