Anasazi  Version of the Day
AnasaziOrthoManager.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 
33 #ifndef ANASAZI_ORTHOMANAGER_HPP
34 #define ANASAZI_ORTHOMANAGER_HPP
35 
50 #include "AnasaziConfigDefs.hpp"
51 #include "AnasaziTypes.hpp"
52 #include "Teuchos_ScalarTraits.hpp"
53 #include "Teuchos_RCP.hpp"
55 #include "Teuchos_Array.hpp"
56 
57 
58 
59 
60 namespace Anasazi {
61 
62 
64 
65 
68  class OrthoError : public AnasaziError
69  {public: OrthoError(const std::string& what_arg) : AnasaziError(what_arg) {}};
70 
72 
73  template <class ScalarType, class MV>
74  class OrthoManager {
75  public:
77 
78  OrthoManager() {};
80 
82  virtual ~OrthoManager() {};
84 
86 
87 
101  virtual void innerProd( const MV &X, const MV &Y, Teuchos::SerialDenseMatrix<int,ScalarType>& Z ) const = 0;
102 
103 
116  virtual void norm( const MV& X, std::vector< typename Teuchos::ScalarTraits<ScalarType>::magnitudeType > &normvec ) const = 0;
117 
118 
119 
158  virtual void project (
159  MV &X,
162  = Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix<int,ScalarType> >(Teuchos::null))
163  ) const = 0;
164 
165 
166 
207  virtual int normalize (
208  MV &X,
209  Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B = Teuchos::null) const = 0;
210 
211 
277  virtual int projectAndNormalize (
278  MV &X,
281  = Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix<int,ScalarType> >(Teuchos::null)),
283  ) const = 0;
284 
286 
288 
289 
295  virtual typename Teuchos::ScalarTraits< ScalarType >::magnitudeType orthonormError(const MV &X) const = 0;
296 
302  virtual typename Teuchos::ScalarTraits<ScalarType>::magnitudeType orthogError(const MV &X1, const MV &X2) const = 0;
303 
305 
306  };
307 
308 } // end of Anasazi namespace
309 
310 
311 #endif
312 
313 // end of file AnasaziOrthoManager.hpp
virtual void norm(const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const =0
Provides the norm induced by innerProd().
virtual Teuchos::ScalarTraits< ScalarType >::magnitudeType orthonormError(const MV &X) const =0
This method computes the error in orthonormality of a multivector.
An exception class parent to all Anasazi exceptions.
virtual int projectAndNormalize(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)), Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const =0
Given a set of bases Q[i] and a multivector X, this method computes an orthonormal basis for ...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
virtual void innerProd(const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const =0
Provides the inner product defining the orthogonality concepts.
virtual int normalize(MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const =0
This method takes a multivector X and attempts to compute a basis for . This basis is orthonormal wit...
virtual Teuchos::ScalarTraits< ScalarType >::magnitudeType orthogError(const MV &X1, const MV &X2) const =0
This method computes the error in orthogonality of two multivectors.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Exception thrown to signal error in an orthogonalization manager method.
OrthoManager()
Default constructor.
Types and exceptions used within Anasazi solvers and interfaces.
Anasazi&#39;s templated virtual class for providing routines for orthogonalization and orthonormalization...
virtual ~OrthoManager()
Destructor.
virtual void project(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null))) const =0
Given a list of mutually orthogonal and internally orthonormal bases Q, this method projects a multiv...