Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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"
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 
83  const Teuchos::RCP<SortManager<ScalarType> > &sorter,
84  const Teuchos::RCP<OutputManager<ScalarType> > &printer,
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 
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 
167 
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 
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 */
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.
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...