Anasazi Version of the Day
Loading...
Searching...
No Matches
AnasaziEigensolver.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Anasazi: Block Eigensolvers Package
4//
5// Copyright 2004 NTESS and the Anasazi contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef ANASAZI_EIGENSOLVER_HPP
11#define ANASAZI_EIGENSOLVER_HPP
12
17#include "AnasaziConfigDefs.hpp"
18#include "AnasaziTypes.hpp"
19
22
27#include "Teuchos_ParameterList.hpp"
28#include "Teuchos_RCP.hpp"
29#include "Teuchos_Array.hpp"
30
31
32namespace Anasazi {
33
34template<class ScalarType, class MV, class OP>
36
37 public:
38
40
41
44
46
50 Eigensolver( const Teuchos::RCP<Eigenproblem<ScalarType,MV,OP> > &problem,
51 const Teuchos::RCP<SortManager<ScalarType> > &sorter,
52 const Teuchos::RCP<OutputManager<ScalarType> > &printer,
53 const Teuchos::RCP<StatusTest<ScalarType,MV,OP> > &tester,
54 const Teuchos::RCP<OrthoManager<ScalarType,MV> > &ortho,
55 Teuchos::ParameterList &params );
56
58 virtual ~Eigensolver() {};
60
61
63
64
68 virtual void iterate() = 0;
69
73 virtual void initialize() = 0;
74
76
77
79
80
82 virtual int getNumIters() const = 0;
83
85 virtual void resetNumIters() = 0;
86
91 virtual Teuchos::RCP<const MV> getRitzVectors() = 0;
92
94 virtual std::vector<Value<ScalarType> > getRitzValues() = 0;
95
104 virtual std::vector<int> getRitzIndex() = 0;
105
107
110 virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getResNorms() = 0;
111
114 virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRes2Norms() = 0;
115
118 virtual std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> getRitzRes2Norms() = 0;
119
121 virtual int getCurSubspaceDim() const = 0;
122
124 virtual int getMaxSubspaceDim() const = 0;
125
127
128
129
131
132
134 virtual void setStatusTest(Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test) = 0;
135
137 virtual Teuchos::RCP<StatusTest<ScalarType,MV,OP> > getStatusTest() const = 0;
138
140 virtual const Eigenproblem<ScalarType,MV,OP>& getProblem() const = 0;
141
143 virtual int getBlockSize() const = 0;
144
146 virtual void setBlockSize(int blockSize) = 0;
147
149 virtual void setAuxVecs(const Teuchos::Array<Teuchos::RCP<const MV> > &auxvecs) = 0;
150
152 virtual Teuchos::Array<Teuchos::RCP<const MV> > getAuxVecs() const = 0;
153
155 virtual bool isInitialized() const = 0;
156
158
160
161
163 virtual void currentStatus(std::ostream &os) = 0;
164
166
167};
168
169} // end Anasazi namespace
170
171#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.