Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_ScaledLinearOpBase.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_SCALED_LINEAR_OP_BASE_HPP
11 #define THYRA_SCALED_LINEAR_OP_BASE_HPP
12 
13 #include "Thyra_LinearOpBase_decl.hpp"
14 
15 
16 namespace Thyra {
17 
18 
49 template<class Scalar>
50 class ScaledLinearOpBase : virtual public LinearOpBase<Scalar> {
51 public:
52 
55 
58  bool supportsScaleLeft() const
59  { return supportsScaleLeftImpl(); }
60 
63  bool supportsScaleRight() const
64  { return supportsScaleRightImpl(); }
65 
70  void scaleLeft(const VectorBase<Scalar> &row_scaling)
71  { scaleLeftImpl(row_scaling); }
72 
77  void scaleRight(const VectorBase<Scalar> &col_scaling)
78  { scaleRightImpl(col_scaling); }
79 
81 
82 protected:
83 
86 
88  virtual bool supportsScaleLeftImpl() const = 0;
89 
91  virtual bool supportsScaleRightImpl() const = 0;
92 
94  virtual void scaleLeftImpl(const VectorBase<Scalar> &row_scaling) = 0;
95 
97  virtual void scaleRightImpl(const VectorBase<Scalar> &col_scaling) = 0;
98 
100 
101 };
102 
103 
104 } // end namespace Thyra
105 
106 
107 #endif // THYRA_SCALED_LINEAR_OP_BASE_HPP
bool supportsScaleRight() const
Determines if this objects supports right scaling.
void scaleLeft(const VectorBase< Scalar > &row_scaling)
Left scales operator with diagonal scaling operator.
virtual void scaleRightImpl(const VectorBase< Scalar > &col_scaling)=0
void scaleRight(const VectorBase< Scalar > &col_scaling)
Right scales operator with diagonal scaling operator.
Abstract interface for finite-dimensional dense vectors.
virtual bool supportsScaleRightImpl() const =0
bool supportsScaleLeft() const
Determines if this objects supports left scaling.
Base class for all linear operators.
Applies left or right sclaing to the linear operator.
virtual bool supportsScaleLeftImpl() const =0
virtual void scaleLeftImpl(const VectorBase< Scalar > &row_scaling)=0