Anasazi  Version of the Day
AnasaziOperator.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_OPERATOR_HPP
34 #define ANASAZI_OPERATOR_HPP
35 
36 #include "AnasaziConfigDefs.hpp"
38 #include "AnasaziMultiVec.hpp"
39 #include "Teuchos_ScalarTraits.hpp"
40 
41 
42 namespace Anasazi {
43 
53  template <class ScalarType>
54  class Operator {
55  public:
57 
58  Operator() {};
60 
62  virtual ~Operator() {};
64 
66 
67 
71  virtual void Apply ( const MultiVec<ScalarType>& x, MultiVec<ScalarType>& y ) const = 0;
72 
74  };
75 
77  //
78  // Implementation of the Anasazi::OperatorTraits for Anasazi::Operator
79  // and Anasazi::MultiVec.
80  //
82 
91  template <class ScalarType>
92  class OperatorTraits < ScalarType, MultiVec<ScalarType>, Operator<ScalarType> >
93  {
94  public:
95 
97 
98 
102  static void Apply ( const Operator<ScalarType>& Op,
103  const MultiVec<ScalarType>& x,
105  { Op.Apply( x, y ); }
106 
108 
109  };
110 
111 } // end of Anasazi namespace
112 
113 #endif
114 
115 // end of file AnasaziOperator.hpp
Virtual base class which defines basic traits for the operator type.
virtual ~Operator()
Destructor.
Interface for multivectors used by Anasazi&#39; linear solvers.
virtual void Apply(const MultiVec< ScalarType > &x, MultiVec< ScalarType > &y) const =0
This method takes the Anasazi::MultiVec x and applies the operator to it resulting in the Anasazi::Mu...
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
static void Apply(const Operator< ScalarType > &Op, const MultiVec< ScalarType > &x, MultiVec< ScalarType > &y)
This method takes the Anasazi::MultiVec x and applies the Anasazi::Operator Op to it resulting in the...
Virtual base class which defines basic traits for the operator type.
Operator()
Default constructor.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
Interface for multivectors used by Anasazi&#39;s linear solvers.
Anasazi&#39;s templated virtual class for constructing an operator that can interface with the OperatorTr...