Thyra Version of the Day
Loading...
Searching...
No Matches
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
16namespace Thyra {
17
18
49template<class Scalar>
50class ScaledLinearOpBase : virtual public LinearOpBase<Scalar> {
51public:
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
82protected:
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
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
void scaleLeft(const VectorBase< Scalar > &row_scaling)
Left scales operator with diagonal scaling operator.
bool supportsScaleRight() const
Determines if this objects supports right scaling.
bool supportsScaleLeft() const
Determines if this objects supports left scaling.
virtual void scaleRightImpl(const VectorBase< Scalar > &col_scaling)=0
void scaleRight(const VectorBase< Scalar > &col_scaling)
Right scales operator with diagonal scaling operator.
virtual bool supportsScaleRightImpl() const =0
Abstract interface for finite-dimensional dense vectors.