Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_DefaultZeroLinearOp_decl.hpp
1// @HEADER
2// ***********************************************************************
3//
4// Thyra: Interfaces and Support for Abstract Numerical Algorithms
5// Copyright (2004) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38//
39// ***********************************************************************
40// @HEADER
41
42#ifndef THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
43#define THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
44
45#include "Thyra_ZeroLinearOpBase.hpp"
46#include "Thyra_RowStatLinearOpBase.hpp"
47#include "Thyra_ScaledLinearOpBase.hpp"
48#include "Teuchos_ConstNonconstObjectContainer.hpp"
49
50
51namespace Thyra {
52
53
70template<class Scalar>
72 : virtual public ZeroLinearOpBase<Scalar>
73 , virtual public RowStatLinearOpBase<Scalar>
74 , virtual public ScaledLinearOpBase<Scalar>
75{
76public:
77
80
88
92 const RCP<const VectorSpaceBase<Scalar> > &range,
94 );
95
112 void initialize(
113 const RCP<const VectorSpaceBase<Scalar> > &range,
114 const RCP<const VectorSpaceBase<Scalar> > &domain
115 );
116
123 void uninitialize();
124
126
129
132
135
138
140
143
147 std::string description() const;
148
150
151protected:
152
155
157 bool opSupportedImpl(EOpTransp M_trans) const;
158
160 void applyImpl(
161 const EOpTransp M_trans,
163 const Ptr<MultiVectorBase<Scalar> > &Y,
164 const Scalar alpha,
165 const Scalar beta
166 ) const;
167
169
172
174 virtual bool rowStatIsSupportedImpl(
175 const RowStatLinearOpBaseUtils::ERowStat rowStat) const;
176
178 virtual void getRowStatImpl(
179 const RowStatLinearOpBaseUtils::ERowStat rowStat,
180 const Teuchos::Ptr<VectorBase< Scalar> > &rowStatVec) const;
181
183
186
188 virtual bool supportsScaleLeftImpl() const
189 { return true; }
190
192 virtual bool supportsScaleRightImpl() const
193 { return true; }
194
195 // Meaningless operation
196 virtual void scaleLeftImpl(const VectorBase< Scalar > &/* row_scaling */)
197 { }
198
199 // Meaningless operation
200 virtual void scaleRightImpl(const VectorBase< Scalar > &/* col_scaling */)
201 { }
202
204
205private:
206
209
210 // Not defined and not to be called
212 DefaultZeroLinearOp& operator=(const DefaultZeroLinearOp&);
213
214};
215
216
221template<class Scalar>
222RCP<const LinearOpBase<Scalar> >
224 const RCP<const VectorSpaceBase<Scalar> > &range,
225 const RCP<const VectorSpaceBase<Scalar> > &domain
226 );
227
235template<class Scalar>
238 const RCP<const VectorSpaceBase<Scalar> > &range,
239 const RCP<const VectorSpaceBase<Scalar> > &domain
240 );
241
242
243} // end namespace Thyra
244
245
246#endif // THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
Represents a zero linear operator M = 0.
virtual void scaleRightImpl(const VectorBase< Scalar > &)
virtual bool rowStatIsSupportedImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat) const
virtual void scaleLeftImpl(const VectorBase< Scalar > &)
void initialize(const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain)
Initialize given a list of non-const linear operators.
virtual void getRowStatImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat, const Teuchos::Ptr< VectorBase< Scalar > > &rowStatVec) const
void uninitialize()
Set to uninitialized.
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns Teuchos::null if uninitialized.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< const VectorSpaceBase< Scalar > > range() const
Returns Teuchos::null if uninitialized.
RCP< LinearOpBase< Scalar > > nonconstZero(const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain)
Create a nonconst zero linear operator with given range and domain spaces.
std::string description() const
Prints just the name DefaultZeroLinearOp along with the overall dimensions.
DefaultZeroLinearOp()
Construct to uninitialized.
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
bool opSupportedImpl(EOpTransp M_trans) const
Returns true .
RCP< const LinearOpBase< Scalar > > zero(const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain)
Create a zero linear operator with given range and domain spaces.
Interface for a collection of column vectors called a multi-vector.
Interface for exxtracting row statistics as a VectorBase from a supporting LinearOpBase object.
Applies left or right sclaing to the linear operator.
Abstract interface for finite-dimensional dense vectors.
Abstract interface for objects that represent a space for vectors.
Interface class for zero linear operators.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.