Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Operator.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TPETRA_OPERATOR_HPP
11 #define TPETRA_OPERATOR_HPP
12 
13 #include <Tpetra_Operator_fwd.hpp>
15 #include <Tpetra_Vector_fwd.hpp>
16 #include <Tpetra_Map_fwd.hpp>
17 #include <Teuchos_Describable.hpp>
18 #include <Teuchos_BLAS_types.hpp>
19 #include <Teuchos_ScalarTraits.hpp>
20 
21 namespace Tpetra {
22 
51  template <class Scalar,
52  class LocalOrdinal,
53  class GlobalOrdinal,
54  class Node>
55  class Operator : virtual public Teuchos::Describable {
56  public:
59 
61  typedef Scalar scalar_type;
62 
64  typedef LocalOrdinal local_ordinal_type;
65 
67  typedef GlobalOrdinal global_ordinal_type;
68 
70  typedef Node node_type;
71 
73 
75 
77  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > getDomainMap() const = 0;
78 
80  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > getRangeMap() const = 0;
81 
83 
88  virtual void
91  Teuchos::ETransp mode = Teuchos::NO_TRANS,
92  Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
93  Scalar beta = Teuchos::ScalarTraits<Scalar>::zero()) const = 0;
94 
101  virtual bool hasTransposeApply() const;
102 
107  virtual bool hasDiagonal() const;
108 
114 
116  };
117 
118  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
120  return false;
121  }
122 
123  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
125  return false;
126  }
127 
128  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
130  TEUCHOS_ASSERT(false);
131  }
132 
133 } // namespace Tpetra
134 
135 #endif // TPETRA_OPERATOR_HPP
Scalar scalar_type
The type of the entries of the input and output multivectors.
Forward declaration of Tpetra::Operator.
Node node_type
The Kokkos Node type.
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
virtual void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const =0
Computes the operator-multivector application.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const =0
The Map associated with the range of this operator, which must be compatible with Y...
virtual void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get the diagonal of the operator.
Abstract interface for operators (e.g., matrices and preconditioners).
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const =0
The Map associated with the domain of this operator, which must be compatible with X...
Forward declaration of Tpetra::MultiVector.
GlobalOrdinal global_ordinal_type
The global index type.
Forward declaration of Tpetra::Vector.
virtual bool hasDiagonal() const
Whether this operator can return its diagonal.
A distributed dense vector.
LocalOrdinal local_ordinal_type
The local index type.
Forward declaration of Tpetra::Map.