Thyra Version of the Day
Loading...
Searching...
No Matches
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
17namespace Thyra {
18
19
49template<class Scalar>
50class DefaultDiagonalLinearOp : virtual public DiagonalLinearOpBase<Scalar>
51{
52public:
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
190protected:
191
195 bool opSupportedImpl(EOpTransp M_trans) const;
197 void applyImpl(
198 const EOpTransp M_trans,
200 const Ptr<MultiVectorBase<Scalar> > &Y,
201 const Scalar alpha,
202 const Scalar beta
203 ) const;
205
206private:
207
209
210};
211
212
217template<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
Default concrete LinearOpBase subclass for diagonal linear operators.
RCP< const VectorSpaceBase< Scalar > > range() const
Returns this->getDiag()->space().
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space)
Initialize given a vector space which allocates a vector internally.
RCP< const VectorBase< Scalar > > getDiag() const
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns this->getDiag()->space().
DefaultDiagonalLinearOp()
Constructs to uninitialized.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< const LinearOpBase< Scalar > > diagonal(const RCP< VectorBase< Scalar > > &diag, const std::string &label="")
Nonmember constructor function.
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.
Interface for a collection of column vectors called a multi-vector.
Abstract interface for finite-dimensional dense vectors.
Abstract interface for objects that represent a space for vectors.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)