Anasazi  Version of the Day
AnasaziEigensolver.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, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
25 //
26 // ***********************************************************************
27 // @HEADER
28 
29 #ifndef ANASAZI_EIGENSOLVER_HPP
30 #define ANASAZI_EIGENSOLVER_HPP
31 
36 #include "AnasaziConfigDefs.hpp"
37 #include "AnasaziTypes.hpp"
38 
41 
42 #include "AnasaziEigenproblem.hpp"
43 #include "AnasaziSortManager.hpp"
44 #include "AnasaziOutputManager.hpp"
45 #include "AnasaziOrthoManager.hpp"
47 #include "Teuchos_RCP.hpp"
48 #include "Teuchos_Array.hpp"
49 
50 
51 namespace Anasazi {
52 
53 template<class ScalarType, class MV, class OP>
54 class Eigensolver {
55 
56  public:
57 
59 
60 
63 
65 
70  const Teuchos::RCP<SortManager<ScalarType> > &sorter,
71  const Teuchos::RCP<OutputManager<ScalarType> > &printer,
74  Teuchos::ParameterList &params );
75 
77  virtual ~Eigensolver() {};
79 
80 
82 
83 
87  virtual void iterate() = 0;
88 
92  virtual void initialize() = 0;
93 
95 
96 
98 
99 
101  virtual int getNumIters() const = 0;
102 
104  virtual void resetNumIters() = 0;
105 
111 
113  virtual std::vector<Value<ScalarType> > getRitzValues() = 0;
114 
123  virtual std::vector<int> getRitzIndex() = 0;
124 
126 
129  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getResNorms() = 0;
130 
133  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRes2Norms() = 0;
134 
137  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRitzRes2Norms() = 0;
138 
140  virtual int getCurSubspaceDim() const = 0;
141 
143  virtual int getMaxSubspaceDim() const = 0;
144 
146 
147 
148 
150 
151 
154 
157 
159  virtual const Eigenproblem<ScalarType,MV,OP>& getProblem() const = 0;
160 
162  virtual int getBlockSize() const = 0;
163 
165  virtual void setBlockSize(int blockSize) = 0;
166 
168  virtual void setAuxVecs(const Teuchos::Array<Teuchos::RCP<const MV> > &auxvecs) = 0;
169 
172 
174  virtual bool isInitialized() const = 0;
175 
177 
179 
180 
182  virtual void currentStatus(std::ostream &os) = 0;
183 
185 
186 };
187 
188 } // end Anasazi namespace
189 
190 #endif /* ANASAZI_EIGENSOLVER_HPP */
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getResNorms()=0
Get the current residual norms.
virtual bool isInitialized() const =0
States whether the solver has been initialized or not.
virtual void initialize()=0
Initialize the solver with the initial vectors from the eigenproblem or random data.
virtual int getBlockSize() const =0
Get the blocksize to be used by the iterative solver in solving this eigenproblem.
virtual Teuchos::Array< Teuchos::RCP< const MV > > getAuxVecs() const =0
Get the auxiliary vectors for the solver.
virtual void iterate()=0
This method performs eigensolvers iterations until the status test indicates the need to stop or an e...
virtual std::vector< Value< ScalarType > > getRitzValues()=0
Get the Ritz values from the previous iteration.
This class defines the interface required by an eigensolver and status test class to compute solution...
virtual void currentStatus(std::ostream &os)=0
This method requests that the solver print out its current status to screen.
virtual int getCurSubspaceDim() const =0
Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues...
virtual void setStatusTest(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)=0
Set a new StatusTest for the solver.
virtual Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getStatusTest() const =0
Get the current StatusTest used by the solver.
virtual void setBlockSize(int blockSize)=0
Set the blocksize to be used by the iterative solver in solving this eigenproblem.
virtual void resetNumIters()=0
Reset the iteration count.
Forward declaration of pure virtual base class Anasazi::StatusTest.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
Forward declaration of the virtual base class Anasazi::Eigensolver.
Abstract class definition for Anasazi Output Managers.
Abstract base class which defines the interface required by an eigensolver and status test class to c...
Output managers remove the need for the eigensolver to know any information about the required output...
Templated virtual class for providing orthogonalization/orthonormalization methods.
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRitzRes2Norms()=0
virtual ~Eigensolver()
Destructor.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Virtual base class which defines the interface between an eigensolver and a class whose job is the so...
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRes2Norms()=0
virtual Teuchos::RCP< const MV > getRitzVectors()=0
Get the Ritz vectors from the previous iteration. These are indexed using getRitzIndex().
virtual std::vector< int > getRitzIndex()=0
Get the index used for indexing the compressed storage used for Ritz vectors for real, non-Hermitian problems.
virtual void setAuxVecs(const Teuchos::Array< Teuchos::RCP< const MV > > &auxvecs)=0
Set the auxiliary vectors for the solver.
virtual const Eigenproblem< ScalarType, MV, OP > & getProblem() const =0
Get a constant reference to the eigenvalue problem.
Types and exceptions used within Anasazi solvers and interfaces.
Eigensolver()
Default Constructor.
Anasazi&#39;s templated virtual class for providing routines for orthogonalization and orthonormalization...
virtual int getMaxSubspaceDim() const =0
Get the maximum dimension allocated for the search subspace.
Anasazi&#39;s templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Common interface of stopping criteria for Anasazi&#39;s solvers.
virtual int getNumIters() const =0
Get the current iteration count.
The Eigensolver is a templated virtual base class that defines the basic interface that any eigensolv...