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 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_EIGENSOLVER_HPP
43 #define ANASAZI_EIGENSOLVER_HPP
44 
49 #include "AnasaziConfigDefs.hpp"
50 #include "AnasaziTypes.hpp"
51 
54 
55 #include "AnasaziEigenproblem.hpp"
56 #include "AnasaziSortManager.hpp"
57 #include "AnasaziOutputManager.hpp"
58 #include "AnasaziOrthoManager.hpp"
59 #include "Teuchos_ParameterList.hpp"
60 #include "Teuchos_RCP.hpp"
61 #include "Teuchos_Array.hpp"
62 
63 
64 namespace Anasazi {
65 
66 template<class ScalarType, class MV, class OP>
67 class Eigensolver {
68 
69  public:
70 
72 
73 
76 
78 
82  Eigensolver( const Teuchos::RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
83  const Teuchos::RCP<SortManager<ScalarType> > &sorter,
84  const Teuchos::RCP<OutputManager<ScalarType> > &printer,
85  const Teuchos::RCP<StatusTest<ScalarType,MV,OP> > &tester,
86  const Teuchos::RCP<OrthoManager<ScalarType,MV> > &ortho,
87  Teuchos::ParameterList &params );
88 
90  virtual ~Eigensolver() {};
92 
93 
95 
96 
100  virtual void iterate() = 0;
101 
105  virtual void initialize() = 0;
106 
108 
109 
111 
112 
114  virtual int getNumIters() const = 0;
115 
117  virtual void resetNumIters() = 0;
118 
123  virtual Teuchos::RCP<const MV> getRitzVectors() = 0;
124 
126  virtual std::vector<Value<ScalarType> > getRitzValues() = 0;
127 
136  virtual std::vector<int> getRitzIndex() = 0;
137 
139 
142  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getResNorms() = 0;
143 
146  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRes2Norms() = 0;
147 
150  virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRitzRes2Norms() = 0;
151 
153  virtual int getCurSubspaceDim() const = 0;
154 
156  virtual int getMaxSubspaceDim() const = 0;
157 
159 
160 
161 
163 
164 
166  virtual void setStatusTest(Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test) = 0;
167 
169  virtual Teuchos::RCP<StatusTest<ScalarType,MV,OP> > getStatusTest() const = 0;
170 
172  virtual const Eigenproblem<ScalarType,MV,OP>& getProblem() const = 0;
173 
175  virtual int getBlockSize() const = 0;
176 
178  virtual void setBlockSize(int blockSize) = 0;
179 
181  virtual void setAuxVecs(const Teuchos::Array<Teuchos::RCP<const MV> > &auxvecs) = 0;
182 
184  virtual Teuchos::Array<Teuchos::RCP<const MV> > getAuxVecs() const = 0;
185 
187  virtual bool isInitialized() const = 0;
188 
190 
192 
193 
195  virtual void currentStatus(std::ostream &os) = 0;
196 
198 
199 };
200 
201 } // end Anasazi namespace
202 
203 #endif /* ANASAZI_EIGENSOLVER_HPP */
AnasaziOrthoManager.hpp
Templated virtual class for providing orthogonalization/orthonormalization methods.
Anasazi::Eigensolver::setBlockSize
virtual void setBlockSize(int blockSize)=0
Set the blocksize to be used by the iterative solver in solving this eigenproblem.
Anasazi::Eigensolver::getBlockSize
virtual int getBlockSize() const =0
Get the blocksize to be used by the iterative solver in solving this eigenproblem.
Anasazi::Eigensolver::getMaxSubspaceDim
virtual int getMaxSubspaceDim() const =0
Get the maximum dimension allocated for the search subspace.
Anasazi::Eigensolver::getStatusTest
virtual Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getStatusTest() const =0
Get the current StatusTest used by the solver.
Anasazi::Eigensolver::currentStatus
virtual void currentStatus(std::ostream &os)=0
This method requests that the solver print out its current status to screen.
Anasazi::Eigensolver::getAuxVecs
virtual Teuchos::Array< Teuchos::RCP< const MV > > getAuxVecs() const =0
Get the auxiliary vectors for the solver.
AnasaziTypes.hpp
Types and exceptions used within Anasazi solvers and interfaces.
Anasazi::Eigensolver::setStatusTest
virtual void setStatusTest(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)=0
Set a new StatusTest for the solver.
AnasaziStatusTestDecl.hpp
Forward declaration of pure virtual base class Anasazi::StatusTest.
AnasaziEigensolverDecl.hpp
Forward declaration of the virtual base class Anasazi::Eigensolver.
Anasazi::SortManager
Anasazi's templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Definition: AnasaziSortManager.hpp:79
AnasaziEigenproblem.hpp
Abstract base class which defines the interface required by an eigensolver and status test class to c...
Anasazi::Eigensolver::getCurSubspaceDim
virtual int getCurSubspaceDim() const =0
Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues.
Anasazi::Eigensolver::initialize
virtual void initialize()=0
Initialize the solver with the initial vectors from the eigenproblem or random data.
Anasazi::Eigensolver::getRitzValues
virtual std::vector< Value< ScalarType > > getRitzValues()=0
Get the Ritz values from the previous iteration.
Anasazi::Eigensolver::resetNumIters
virtual void resetNumIters()=0
Reset the iteration count.
Anasazi::OutputManager
Output managers remove the need for the eigensolver to know any information about the required output...
Definition: AnasaziOutputManager.hpp:68
AnasaziSortManager.hpp
Virtual base class which defines the interface between an eigensolver and a class whose job is the so...
Anasazi::Eigensolver::getRitzVectors
virtual Teuchos::RCP< const MV > getRitzVectors()=0
Get the Ritz vectors from the previous iteration. These are indexed using getRitzIndex().
Anasazi::Eigensolver
The Eigensolver is a templated virtual base class that defines the basic interface that any eigensolv...
Definition: AnasaziEigensolver.hpp:67
Anasazi::Eigensolver::getRes2Norms
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRes2Norms()=0
Anasazi::Eigensolver::~Eigensolver
virtual ~Eigensolver()
Destructor.
Definition: AnasaziEigensolver.hpp:90
Anasazi::Eigensolver::getRitzRes2Norms
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRitzRes2Norms()=0
Anasazi::Eigensolver::getRitzIndex
virtual std::vector< int > getRitzIndex()=0
Get the index used for indexing the compressed storage used for Ritz vectors for real,...
Anasazi::Eigensolver::Eigensolver
Eigensolver(const Teuchos::RCP< Eigenproblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< SortManager< ScalarType > > &sorter, const Teuchos::RCP< OutputManager< ScalarType > > &printer, const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &tester, const Teuchos::RCP< OrthoManager< ScalarType, MV > > &ortho, Teuchos::ParameterList &params)
Basic Constructor.
Anasazi
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
Anasazi::Eigenproblem
This class defines the interface required by an eigensolver and status test class to compute solution...
Definition: AnasaziEigenproblem.hpp:64
Anasazi::Eigensolver::Eigensolver
Eigensolver()
Default Constructor.
Definition: AnasaziEigensolver.hpp:75
Anasazi::Eigensolver::getNumIters
virtual int getNumIters() const =0
Get the current iteration count.
Anasazi::Eigensolver::isInitialized
virtual bool isInitialized() const =0
States whether the solver has been initialized or not.
Anasazi::StatusTest
Common interface of stopping criteria for Anasazi's solvers.
Definition: AnasaziStatusTest.hpp:75
Anasazi::Eigensolver::getProblem
virtual const Eigenproblem< ScalarType, MV, OP > & getProblem() const =0
Get a constant reference to the eigenvalue problem.
Anasazi::Eigensolver::iterate
virtual void iterate()=0
This method performs eigensolvers iterations until the status test indicates the need to stop or an e...
Anasazi::Eigensolver::getResNorms
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getResNorms()=0
Get the current residual norms.
Anasazi::Eigensolver::setAuxVecs
virtual void setAuxVecs(const Teuchos::Array< Teuchos::RCP< const MV > > &auxvecs)=0
Set the auxiliary vectors for the solver.
AnasaziConfigDefs.hpp
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
Anasazi::OrthoManager
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
Definition: AnasaziOrthoManager.hpp:87
AnasaziOutputManager.hpp
Abstract class definition for Anasazi Output Managers.