Anasazi  Version of the Day
AnasaziTypes.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_TYPES_HPP
43 #define ANASAZI_TYPES_HPP
44 
45 #include "AnasaziConfigDefs.hpp"
46 #include "Teuchos_RCP.hpp"
47 #include "Teuchos_ScalarTraits.hpp"
48 
53 namespace Anasazi {
54 
55 typedef Teuchos_Ordinal Array_size_type;
56 
58 
59 
63  class AnasaziError : public std::logic_error {
64  public: AnasaziError(const std::string& what_arg) : std::logic_error(what_arg) {}
65  };
66 
68 
70 
71 
73  template <class ScalarType>
74  struct Value {
76  typename Teuchos::ScalarTraits<ScalarType>::magnitudeType realpart;
78  typename Teuchos::ScalarTraits<ScalarType>::magnitudeType imagpart;
79  void set(const typename Teuchos::ScalarTraits<ScalarType>::magnitudeType &rp, const typename Teuchos::ScalarTraits<ScalarType>::magnitudeType &ip){
80  realpart=rp;imagpart=ip;
81  }
82  Value<ScalarType> &operator=(const Value<ScalarType> &rhs) {
84  return *this;
85  }
86  };
87 
89  template <class ScalarType, class MV>
90  struct Eigensolution {
92  Teuchos::RCP<MV> Evecs;
94  Teuchos::RCP<MV> Espace;
96  std::vector<Value<ScalarType> > Evals;
105  std::vector<int> index;
107  int numVecs;
108 
109  Eigensolution() : Evecs(),Espace(),Evals(0),index(0),numVecs(0) {}
110  };
111 
113 
115 
116 
121  {
124  };
125 
126 
131  enum ConjType
132  {
135  };
136 
137 
142  {
143  Passed = 0x1,
144  Failed = 0x2,
145  Undefined = 0x4
146  };
147 
151  enum ResType {
152  RES_ORTH,
153  RES_2NORM,
154  RITZRES_2NORM
155  };
156 
157 
161  enum MsgType
162  {
163  Errors = 0,
164  Warnings = 0x1,
166  OrthoDetails = 0x4,
167  FinalSummary = 0x8,
168  TimingDetails = 0x10,
170  Debug = 0x40
171  };
172 
174 
175 } // end of namespace Anasazi
176 #endif
177 // end of file AnasaziTypes.hpp
Anasazi::Passed
Definition: AnasaziTypes.hpp:143
Anasazi::Unconverged
Definition: AnasaziTypes.hpp:123
Anasazi::Value::imagpart
Teuchos::ScalarTraits< ScalarType >::magnitudeType imagpart
The imaginary component of the eigenvalue.
Definition: AnasaziTypes.hpp:78
Anasazi::Value::realpart
Teuchos::ScalarTraits< ScalarType >::magnitudeType realpart
The real component of the eigenvalue.
Definition: AnasaziTypes.hpp:76
Anasazi::ResType
ResType
Enumerated type used to specify which residual norm used by residual norm status tests.
Definition: AnasaziTypes.hpp:151
Anasazi::Eigensolution::Evecs
Teuchos::RCP< MV > Evecs
The computed eigenvectors.
Definition: AnasaziTypes.hpp:92
Anasazi::Value
This struct is used for storing eigenvalues and Ritz values, as a pair of real values.
Definition: AnasaziTypes.hpp:74
Anasazi::Eigensolution::Evals
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.
Definition: AnasaziTypes.hpp:96
Anasazi::Eigensolution::index
std::vector< int > index
An index into Evecs to allow compressed storage of eigenvectors for real, non-Hermitian problems.
Definition: AnasaziTypes.hpp:105
Anasazi::OrthoDetails
Definition: AnasaziTypes.hpp:166
Anasazi::StatusTestDetails
Definition: AnasaziTypes.hpp:169
Anasazi::Failed
Definition: AnasaziTypes.hpp:144
Anasazi::TestStatus
TestStatus
Enumerated type used to pass back information from a StatusTest.
Definition: AnasaziTypes.hpp:141
Anasazi::Converged
Definition: AnasaziTypes.hpp:122
Anasazi::ReturnType
ReturnType
Enumerated type used to pass back information from a solver manager.
Definition: AnasaziTypes.hpp:120
Anasazi::Errors
Definition: AnasaziTypes.hpp:163
Anasazi::ConjType
ConjType
Enumerated types used to specify conjugation arguments.
Definition: AnasaziTypes.hpp:131
Anasazi::Warnings
Definition: AnasaziTypes.hpp:164
Anasazi::TimingDetails
Definition: AnasaziTypes.hpp:168
Anasazi::Debug
Definition: AnasaziTypes.hpp:170
Anasazi::Eigensolution::Espace
Teuchos::RCP< MV > Espace
An orthonormal basis for the computed eigenspace.
Definition: AnasaziTypes.hpp:94
Anasazi
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
Anasazi::MsgType
MsgType
Enumerated list of available message types recognized by the eigensolvers.
Definition: AnasaziTypes.hpp:161
Anasazi::Eigensolution::numVecs
int numVecs
The number of computed eigenpairs.
Definition: AnasaziTypes.hpp:107
Anasazi::FinalSummary
Definition: AnasaziTypes.hpp:167
Anasazi::AnasaziError
An exception class parent to all Anasazi exceptions.
Definition: AnasaziTypes.hpp:63
Anasazi::IterationDetails
Definition: AnasaziTypes.hpp:165
Anasazi::CONJ
Definition: AnasaziTypes.hpp:134
Anasazi::NO_CONJ
Definition: AnasaziTypes.hpp:133
Anasazi::Undefined
Definition: AnasaziTypes.hpp:145
AnasaziConfigDefs.hpp
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
Anasazi::Eigensolution
Struct for storing an eigenproblem solution.
Definition: AnasaziTypes.hpp:90