Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
support
operator_vector
client_support
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
51
namespace
Thyra {
52
53
70
template
<
class
Scalar>
71
class
DefaultZeroLinearOp
72
:
virtual
public
ZeroLinearOpBase
<Scalar>
73
,
virtual
public
RowStatLinearOpBase
<Scalar>
74
,
virtual
public
ScaledLinearOpBase
<Scalar>
75
{
76
public
:
77
80
87
DefaultZeroLinearOp
();
88
91
DefaultZeroLinearOp
(
92
const
RCP
<
const
VectorSpaceBase<Scalar>
> &
range
,
93
const
RCP
<
const
VectorSpaceBase<Scalar>
> &
domain
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
131
RCP< const VectorSpaceBase<Scalar>
>
range
()
const
;
132
134
RCP< const VectorSpaceBase<Scalar>
>
domain
()
const
;
135
137
RCP<const LinearOpBase<Scalar>
>
clone
()
const
;
138
140
143
147
std::string
description
()
const
;
148
150
151
protected
:
152
155
157
bool
opSupportedImpl
(EOpTransp M_trans)
const
;
158
160
void
applyImpl
(
161
const
EOpTransp M_trans,
162
const
MultiVectorBase<Scalar>
&X,
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
// Meaningless operation
196
virtual
void
scaleLeftImpl
(
const
VectorBase< Scalar >
&
/* row_scaling */
)
197
{ }
198
// Meaningless operation
200
virtual
void
scaleRightImpl
(
const
VectorBase< Scalar >
&
/* col_scaling */
)
201
{ }
202
204
205
private
:
206
207
RCP<const VectorSpaceBase<Scalar>
> range_;
208
RCP<const VectorSpaceBase<Scalar>
> domain_;
209
210
// Not defined and not to be called
211
DefaultZeroLinearOp
(
const
DefaultZeroLinearOp
&);
212
DefaultZeroLinearOp
& operator=(
const
DefaultZeroLinearOp
&);
213
214
};
215
216
221
template
<
class
Scalar>
222
RCP<const LinearOpBase<Scalar> >
223
zero
(
224
const
RCP
<
const
VectorSpaceBase<Scalar>
> &
range
,
225
const
RCP
<
const
VectorSpaceBase<Scalar>
> &
domain
226
);
227
235
template
<
class
Scalar>
236
RCP<LinearOpBase<Scalar>
>
237
nonconstZero
(
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
Teuchos::Ptr
Teuchos::RCP
Thyra::DefaultZeroLinearOp
Represents a zero linear operator M = 0.
Definition
Thyra_DefaultZeroLinearOp_decl.hpp:75
Thyra::DefaultZeroLinearOp::scaleRightImpl
virtual void scaleRightImpl(const VectorBase< Scalar > &)
Definition
Thyra_DefaultZeroLinearOp_decl.hpp:200
Thyra::DefaultZeroLinearOp::rowStatIsSupportedImpl
virtual bool rowStatIsSupportedImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat) const
Definition
Thyra_DefaultZeroLinearOp_def.hpp:173
Thyra::DefaultZeroLinearOp::scaleLeftImpl
virtual void scaleLeftImpl(const VectorBase< Scalar > &)
Definition
Thyra_DefaultZeroLinearOp_decl.hpp:196
Thyra::DefaultZeroLinearOp::supportsScaleLeftImpl
virtual bool supportsScaleLeftImpl() const
Definition
Thyra_DefaultZeroLinearOp_decl.hpp:188
Thyra::DefaultZeroLinearOp::supportsScaleRightImpl
virtual bool supportsScaleRightImpl() const
Definition
Thyra_DefaultZeroLinearOp_decl.hpp:192
Thyra::DefaultZeroLinearOp::initialize
void initialize(const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain)
Initialize given a list of non-const linear operators.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:73
Thyra::DefaultZeroLinearOp::getRowStatImpl
virtual void getRowStatImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat, const Teuchos::Ptr< VectorBase< Scalar > > &rowStatVec) const
Definition
Thyra_DefaultZeroLinearOp_def.hpp:188
Thyra::DefaultZeroLinearOp::uninitialize
void uninitialize()
Set to uninitialized.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:84
Thyra::DefaultZeroLinearOp::domain
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns Teuchos::null if uninitialized.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:104
Thyra::DefaultZeroLinearOp::clone
RCP< const LinearOpBase< Scalar > > clone() const
Definition
Thyra_DefaultZeroLinearOp_def.hpp:112
Thyra::DefaultZeroLinearOp::range
RCP< const VectorSpaceBase< Scalar > > range() const
Returns Teuchos::null if uninitialized.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:96
Thyra::DefaultZeroLinearOp::nonconstZero
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.
Thyra::DefaultZeroLinearOp::description
std::string description() const
Prints just the name DefaultZeroLinearOp along with the overall dimensions.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:125
Thyra::DefaultZeroLinearOp::DefaultZeroLinearOp
DefaultZeroLinearOp()
Construct to uninitialized.
Definition
Thyra_DefaultZeroLinearOp_def.hpp:58
Thyra::DefaultZeroLinearOp::applyImpl
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
Definition
Thyra_DefaultZeroLinearOp_def.hpp:152
Thyra::DefaultZeroLinearOp::opSupportedImpl
bool opSupportedImpl(EOpTransp M_trans) const
Returns true .
Definition
Thyra_DefaultZeroLinearOp_def.hpp:145
Thyra::DefaultZeroLinearOp::zero
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.
Thyra::MultiVectorBase
Interface for a collection of column vectors called a multi-vector.
Definition
Thyra_MultiVectorBase_decl.hpp:496
Thyra::RowStatLinearOpBase
Interface for exxtracting row statistics as a VectorBase from a supporting LinearOpBase object.
Definition
Thyra_RowStatLinearOpBase.hpp:76
Thyra::ScaledLinearOpBase
Applies left or right sclaing to the linear operator.
Definition
Thyra_ScaledLinearOpBase.hpp:82
Thyra::VectorBase
Abstract interface for finite-dimensional dense vectors.
Definition
Thyra_VectorBase.hpp:147
Thyra::VectorSpaceBase
Abstract interface for objects that represent a space for vectors.
Definition
Thyra_VectorSpaceBase_decl.hpp:299
Thyra::ZeroLinearOpBase
Interface class for zero linear operators.
Definition
Thyra_ZeroLinearOpBase.hpp:69
Generated by
1.17.0