Anasazi Version of the Day
Loading...
Searching...
No Matches
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
59#include "Teuchos_ParameterList.hpp"
60#include "Teuchos_RCP.hpp"
61#include "Teuchos_Array.hpp"
62
63
64namespace Anasazi {
65
66template<class ScalarType, class MV, class OP>
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 */
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
Abstract base class which defines the interface required by an eigensolver and status test class to c...
Forward declaration of the virtual base class Anasazi::Eigensolver.
Templated virtual class for providing orthogonalization/orthonormalization methods.
Abstract class definition for Anasazi Output Managers.
Virtual base class which defines the interface between an eigensolver and a class whose job is the so...
Forward declaration of pure virtual base class Anasazi::StatusTest.
Types and exceptions used within Anasazi solvers and interfaces.
This class defines the interface required by an eigensolver and status test class to compute solution...
The Eigensolver is a templated virtual base class that defines the basic interface that any eigensolv...
virtual void setAuxVecs(const Teuchos::Array< Teuchos::RCP< const MV > > &auxvecs)=0
Set the auxiliary vectors for the solver.
virtual void currentStatus(std::ostream &os)=0
This method requests that the solver print out its current status to screen.
virtual Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getStatusTest() const =0
Get the current StatusTest used by the solver.
virtual ~Eigensolver()
Destructor.
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRes2Norms()=0
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getResNorms()=0
Get the current residual norms.
virtual const Eigenproblem< ScalarType, MV, OP > & getProblem() const =0
Get a constant reference to the eigenvalue problem.
virtual int getMaxSubspaceDim() const =0
Get the maximum dimension allocated for the search subspace.
virtual void initialize()=0
Initialize the solver with the initial vectors from the eigenproblem or random data.
virtual void resetNumIters()=0
Reset the iteration count.
virtual void setBlockSize(int blockSize)=0
Set the blocksize to be used by the iterative solver in solving this eigenproblem.
virtual Teuchos::RCP< const MV > getRitzVectors()=0
Get the Ritz vectors from the previous iteration. These are indexed using getRitzIndex().
virtual void setStatusTest(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)=0
Set a new StatusTest for the solver.
virtual std::vector< int > getRitzIndex()=0
Get the index used for indexing the compressed storage used for Ritz vectors for real,...
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 std::vector< Value< ScalarType > > getRitzValues()=0
Get the Ritz values from the previous iteration.
virtual bool isInitialized() const =0
States whether the solver has been initialized or not.
virtual int getCurSubspaceDim() const =0
Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues.
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.
virtual int getNumIters() const =0
Get the current iteration count.
Eigensolver()
Default Constructor.
virtual std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getRitzRes2Norms()=0
virtual void iterate()=0
This method performs eigensolvers iterations until the status test indicates the need to stop or an e...
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
Output managers remove the need for the eigensolver to know any information about the required output...
Anasazi's templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Common interface of stopping criteria for Anasazi's solvers.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.