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, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
25 //
26 // ***********************************************************************
27 // @HEADER
28 
29 #ifndef ANASAZI_TYPES_HPP
30 #define ANASAZI_TYPES_HPP
31 
32 #include "AnasaziConfigDefs.hpp"
33 #include "Teuchos_RCP.hpp"
34 #include "Teuchos_ScalarTraits.hpp"
35 
40 namespace Anasazi {
41 
42 typedef Teuchos_Ordinal Array_size_type;
43 
45 
46 
50  class AnasaziError : public std::logic_error {
51  public: AnasaziError(const std::string& what_arg) : std::logic_error(what_arg) {}
52  };
53 
55 
57 
58 
60  template <class ScalarType>
61  struct Value {
63  typename Teuchos::ScalarTraits<ScalarType>::magnitudeType realpart;
65  typename Teuchos::ScalarTraits<ScalarType>::magnitudeType imagpart;
66  void set(const typename Teuchos::ScalarTraits<ScalarType>::magnitudeType &rp, const typename Teuchos::ScalarTraits<ScalarType>::magnitudeType &ip){
67  realpart=rp;imagpart=ip;
68  }
69  Value<ScalarType> &operator=(const Value<ScalarType> &rhs) {
70  realpart=rhs.realpart;imagpart=rhs.imagpart;
71  return *this;
72  }
73  };
74 
76  template <class ScalarType, class MV>
77  struct Eigensolution {
79  Teuchos::RCP<MV> Evecs;
81  Teuchos::RCP<MV> Espace;
83  std::vector<Value<ScalarType> > Evals;
92  std::vector<int> index;
94  int numVecs;
95 
96  Eigensolution() : Evecs(),Espace(),Evals(0),index(0),numVecs(0) {}
97  };
98 
100 
102 
103 
108  {
111  };
112 
113 
118  enum ConjType
119  {
122  };
123 
124 
129  {
130  Passed = 0x1,
131  Failed = 0x2,
132  Undefined = 0x4
133  };
134 
138  enum ResType {
139  RES_ORTH,
140  RES_2NORM,
141  RITZRES_2NORM
142  };
143 
144 
148  enum MsgType
149  {
150  Errors = 0,
151  Warnings = 0x1,
153  OrthoDetails = 0x4,
154  FinalSummary = 0x8,
155  TimingDetails = 0x10,
157  Debug = 0x40
158  };
159 
161 
162 } // end of namespace Anasazi
163 #endif
164 // end of file AnasaziTypes.hpp
std::vector< Value< ScalarType > > Evals
The computed eigenvalues.
ResType
Enumerated type used to specify which residual norm used by residual norm status tests.
Teuchos::ScalarTraits< ScalarType >::magnitudeType imagpart
The imaginary component of the eigenvalue.
Teuchos::RCP< MV > Evecs
The computed eigenvectors.
An exception class parent to all Anasazi exceptions.
TestStatus
Enumerated type used to pass back information from a StatusTest.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
int numVecs
The number of computed eigenpairs.
ConjType
Enumerated types used to specify conjugation arguments.
Teuchos::RCP< MV > Espace
An orthonormal basis for the computed eigenspace.
ReturnType
Enumerated type used to pass back information from a solver manager.
std::vector< int > index
An index into Evecs to allow compressed storage of eigenvectors for real, non-Hermitian problems...
This struct is used for storing eigenvalues and Ritz values, as a pair of real values.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Struct for storing an eigenproblem solution.
MsgType
Enumerated list of available message types recognized by the eigensolvers.
Teuchos::ScalarTraits< ScalarType >::magnitudeType realpart
The real component of the eigenvalue.