Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DefaultZeroLinearOp_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_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
11 #define THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
12 
13 #include "Thyra_ZeroLinearOpBase.hpp"
14 #include "Thyra_RowStatLinearOpBase.hpp"
15 #include "Thyra_ScaledLinearOpBase.hpp"
16 #include "Teuchos_ConstNonconstObjectContainer.hpp"
17 
18 
19 namespace Thyra {
20 
21 
38 template<class Scalar>
40  : virtual public ZeroLinearOpBase<Scalar>
41  , virtual public RowStatLinearOpBase<Scalar>
42  , virtual public ScaledLinearOpBase<Scalar>
43 {
44 public:
45 
48 
56 
60  const RCP<const VectorSpaceBase<Scalar> > &range,
61  const RCP<const VectorSpaceBase<Scalar> > &domain
62  );
63 
80  void initialize(
81  const RCP<const VectorSpaceBase<Scalar> > &range,
82  const RCP<const VectorSpaceBase<Scalar> > &domain
83  );
84 
91  void uninitialize();
92 
94 
97 
100 
103 
106 
108 
111 
115  std::string description() const;
116 
118 
119 protected:
120 
123 
125  bool opSupportedImpl(EOpTransp M_trans) const;
126 
128  void applyImpl(
129  const EOpTransp M_trans,
130  const MultiVectorBase<Scalar> &X,
131  const Ptr<MultiVectorBase<Scalar> > &Y,
132  const Scalar alpha,
133  const Scalar beta
134  ) const;
135 
137 
140 
142  virtual bool rowStatIsSupportedImpl(
143  const RowStatLinearOpBaseUtils::ERowStat rowStat) const;
144 
146  virtual void getRowStatImpl(
147  const RowStatLinearOpBaseUtils::ERowStat rowStat,
148  const Teuchos::Ptr<VectorBase< Scalar> > &rowStatVec) const;
149 
151 
154 
156  virtual bool supportsScaleLeftImpl() const
157  { return true; }
158 
160  virtual bool supportsScaleRightImpl() const
161  { return true; }
162  // Meaningless operation
164  virtual void scaleLeftImpl(const VectorBase< Scalar > &/* row_scaling */)
165  { }
166  // Meaningless operation
168  virtual void scaleRightImpl(const VectorBase< Scalar > &/* col_scaling */)
169  { }
170 
172 
173 private:
174 
177 
178  // Not defined and not to be called
180  DefaultZeroLinearOp& operator=(const DefaultZeroLinearOp&);
181 
182 };
183 
184 
189 template<class Scalar>
190 RCP<const LinearOpBase<Scalar> >
191 zero(
192  const RCP<const VectorSpaceBase<Scalar> > &range,
193  const RCP<const VectorSpaceBase<Scalar> > &domain
194  );
195 
203 template<class Scalar>
204 RCP<LinearOpBase<Scalar> >
205 nonconstZero(
206  const RCP<const VectorSpaceBase<Scalar> > &range,
207  const RCP<const VectorSpaceBase<Scalar> > &domain
208  );
209 
210 
211 } // end namespace Thyra
212 
213 
214 #endif // THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
void uninitialize()
Set to uninitialized.
virtual bool rowStatIsSupportedImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat) const
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
virtual void getRowStatImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat, const Teuchos::Ptr< VectorBase< Scalar > > &rowStatVec) const
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns Teuchos::null if uninitialized.
Interface class for zero linear operators.
Abstract interface for objects that represent a space for vectors.
bool opSupportedImpl(EOpTransp M_trans) const
Returns true .
RCP< const LinearOpBase< Scalar > > clone() const
Interface for a collection of column vectors called a multi-vector.
DefaultZeroLinearOp()
Construct to uninitialized.
Abstract interface for finite-dimensional dense vectors.
virtual void scaleRightImpl(const VectorBase< Scalar > &)
Applies left or right sclaing to the linear operator.
RCP< const VectorSpaceBase< Scalar > > range() const
Returns Teuchos::null if uninitialized.
Interface for exxtracting row statistics as a VectorBase from a supporting LinearOpBase object...
Represents a zero linear operator M = 0.
virtual void scaleLeftImpl(const VectorBase< Scalar > &)
std::string description() const
Prints just the name DefaultZeroLinearOp along with the overall dimensions.
void initialize(const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain)
Initialize given a list of non-const linear operators.
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const