Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DefaultDiagonalLinearOp_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_DIAGONAL_LINEAR_OP_DECL_HPP
11 #define THYRA_DIAGONAL_LINEAR_OP_DECL_HPP
12 
13 #include "Thyra_DiagonalLinearOpBase.hpp"
14 #include "Teuchos_ConstNonconstObjectContainer.hpp"
15 
16 
17 namespace Thyra {
18 
19 
49 template<class Scalar>
50 class DefaultDiagonalLinearOp : virtual public DiagonalLinearOpBase<Scalar>
51 {
52 public:
53 
56 
64 
68  const RCP<const VectorSpaceBase<Scalar> > &space
69  );
70 
75  const RCP<VectorBase<Scalar> > &diag
76  );
77 
82  const RCP<const VectorBase<Scalar> > &diag
83  );
84 
100  void initialize(
101  const RCP<const VectorSpaceBase<Scalar> > &space
102  );
103 
119  void initialize(const RCP<VectorBase<Scalar> > &diag);
120 
136  void initialize(
137  const RCP<const VectorBase<Scalar> > &diag
138  );
139 
154  void uninitialize();
155 
157 
160 
162  bool isDiagConst() const;
167 
169 
189 
190 protected:
191 
195  bool opSupportedImpl(EOpTransp M_trans) const;
197  void applyImpl(
198  const EOpTransp M_trans,
199  const MultiVectorBase<Scalar> &X,
200  const Ptr<MultiVectorBase<Scalar> > &Y,
201  const Scalar alpha,
202  const Scalar beta
203  ) const;
205 
206 private:
207 
209 
210 };
211 
212 
217 template<class Scalar>
220  const RCP<VectorBase<Scalar> > &diag,
221  const std::string &label = ""
222  )
223 {
226  if (label.length())
227  dlo->setObjectLabel(label);
228  return dlo;
229 }
230 
231 
232 } // end namespace Thyra
233 
234 
235 #endif // THYRA_DIAGONAL_LINEAR_OP_DECL_HPP
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns this-&gt;getDiag()-&gt;space().
RCP< const LinearOpBase< Scalar > > diagonal(const RCP< VectorBase< Scalar > > &diag, const std::string &label="")
Nonmember constructor function.
RCP< const VectorBase< Scalar > > getDiag() const
Abstract interface for objects that represent a space for vectors.
RCP< const LinearOpBase< Scalar > > clone() const
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space)
Initialize given a vector space which allocates a vector internally.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Interface for a collection of column vectors called a multi-vector.
Abstract interface for finite-dimensional dense vectors.
DefaultDiagonalLinearOp()
Constructs to uninitialized.
RCP< const VectorSpaceBase< Scalar > > range() const
Returns this-&gt;getDiag()-&gt;space().
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
Interface class for for diagonal linear operators.
Default concrete LinearOpBase subclass for diagonal linear operators.