Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
support
operator_solve
client_support
Thyra_DefaultAdjointLinearOpWithSolve_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_ADJOINT_LINEAR_OP_WITH_SOLVE_DECL_HPP
11
#define THYRA_DEFAULT_ADJOINT_LINEAR_OP_WITH_SOLVE_DECL_HPP
12
13
14
#include "Thyra_LinearOpWithSolveBase.hpp"
15
#include "Teuchos_ConstNonconstObjectContainer.hpp"
16
17
18
namespace
Thyra {
19
20
26
template
<
class
Scalar>
27
class
DefaultAdjointLinearOpWithSolve
:
virtual
public
LinearOpWithSolveBase
<Scalar>
28
{
29
public
:
30
33
35
DefaultAdjointLinearOpWithSolve
();
36
38
void
initialize
(
const
RCP
<
LinearOpWithSolveBase<Scalar>
> &lows,
39
const
EOpTransp transp );
40
42
void
initialize
(
const
RCP
<
const
LinearOpWithSolveBase<Scalar>
> &lows,
43
const
EOpTransp transp );
44
46
const
RCP<LinearOpWithSolveBase<Scalar>
>
getNonconstOp
();
47
49
const
RCP<const LinearOpWithSolveBase<Scalar>
>
getOp
()
const
;
50
52
55
57
RCP<const VectorSpaceBase<Scalar>
>
range
()
const
;
59
RCP<const VectorSpaceBase<Scalar>
>
domain
()
const
;
60
62
63
protected
:
64
67
68
bool
opSupportedImpl
(EOpTransp M_trans)
const
;
70
void
applyImpl
(
71
const
EOpTransp M_trans,
72
const
MultiVectorBase<Scalar>
&X,
73
const
Ptr
<
MultiVectorBase<Scalar>
> &Y,
74
const
Scalar alpha,
75
const
Scalar beta
76
)
const
;
78
81
82
bool
solveSupportsImpl
(EOpTransp M_trans)
const
;
84
bool
solveSupportsSolveMeasureTypeImpl
(
85
EOpTransp M_trans,
const
SolveMeasureType
& solveMeasureType)
const
;
87
SolveStatus<Scalar>
solveImpl
(
88
const
EOpTransp transp,
89
const
MultiVectorBase<Scalar>
&B,
90
const
Ptr
<
MultiVectorBase<Scalar>
> &X,
91
const
Ptr
<
const
SolveCriteria<Scalar>
> solveCriteria
92
)
const
;
94
95
private
:
96
97
// //////////////////////////
98
// Private types
99
100
typedef
Teuchos::ConstNonconstObjectContainer<LinearOpWithSolveBase<Scalar>
>
101
CNCLOWS;
102
103
// /////////////////////////
104
// Private data members
105
106
CNCLOWS lows_;
107
EOpTransp transp_;
108
109
};
110
111
116
template
<
class
Scalar>
117
RCP<DefaultAdjointLinearOpWithSolve<Scalar>
>
118
defaultAdjointLinearOpWithSolve(
119
const
RCP
<
const
LinearOpWithSolveBase<Scalar>
> &lows,
120
const
EOpTransp transp )
121
{
122
RCP<DefaultAdjointLinearOpWithSolve<Scalar>
>
123
dalows =
Teuchos::rcp
(
new
DefaultAdjointLinearOpWithSolve<Scalar>
);
124
dalows->initialize(lows, transp);
125
return
dalows;
126
}
127
128
133
template
<
class
Scalar>
134
RCP<DefaultAdjointLinearOpWithSolve<Scalar> >
135
defaultAdjointLinearOpWithSolveNonconst(
136
const
RCP<LinearOpWithSolveBase<Scalar> > &lows,
137
const
EOpTransp transp )
138
{
139
RCP<DefaultAdjointLinearOpWithSolve<Scalar> >
140
dalows =
Teuchos::rcp
(
new
DefaultAdjointLinearOpWithSolve<Scalar>);
141
dalows->initialize(lows, transp);
142
return
dalows;
143
}
144
145
150
template
<
class
Scalar>
151
RCP<const LinearOpWithSolveBase<Scalar>
>
152
adjointLows(
const
RCP
<
const
LinearOpWithSolveBase<Scalar>
> &lows )
153
{
154
return
defaultAdjointLinearOpWithSolve<Scalar>(lows, CONJTRANS);
155
}
156
157
162
template
<
class
Scalar>
163
RCP<LinearOpWithSolveBase<Scalar>
>
164
nonconstAdjointLows(
const
RCP
<
LinearOpWithSolveBase<Scalar>
> &lows )
165
{
166
return
defaultAdjointLinearOpWithSolveNonconst<Scalar>(lows, CONJTRANS);
167
}
168
169
170
171
}
// end namespace Thyra
172
173
174
#endif
// THYRA_DEFAULT_ADJOINT_LINEAR_OP_WITH_SOLVE_DECL_HPP
Teuchos::ConstNonconstObjectContainer
Teuchos::Ptr
Teuchos::RCP
Thyra::DefaultAdjointLinearOpWithSolve
Default concreate decorator subclass for a transpose/adjoint LinearOpWithSolveBase object.
Definition
Thyra_DefaultAdjointLinearOpWithSolve_decl.hpp:28
Thyra::DefaultAdjointLinearOpWithSolve::initialize
void initialize(const RCP< LinearOpWithSolveBase< Scalar > > &lows, const EOpTransp transp)
Initialize with non-const LOWSB .
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:31
Thyra::DefaultAdjointLinearOpWithSolve::getOp
const RCP< const LinearOpWithSolveBase< Scalar > > getOp() const
Get the const underlying LOWSB object.
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:60
Thyra::DefaultAdjointLinearOpWithSolve::domain
RCP< const VectorSpaceBase< Scalar > > domain() const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:80
Thyra::DefaultAdjointLinearOpWithSolve::DefaultAdjointLinearOpWithSolve
DefaultAdjointLinearOpWithSolve()
Constructs to uninitialized.
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:25
Thyra::DefaultAdjointLinearOpWithSolve::range
RCP< const VectorSpaceBase< Scalar > > range() const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:71
Thyra::DefaultAdjointLinearOpWithSolve::solveSupportsImpl
bool solveSupportsImpl(EOpTransp M_trans) const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:119
Thyra::DefaultAdjointLinearOpWithSolve::getNonconstOp
const RCP< LinearOpWithSolveBase< Scalar > > getNonconstOp()
Get the non-const underlying LOWSB object.
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:52
Thyra::DefaultAdjointLinearOpWithSolve::opSupportedImpl
bool opSupportedImpl(EOpTransp M_trans) const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:94
Thyra::DefaultAdjointLinearOpWithSolve::solveImpl
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:137
Thyra::DefaultAdjointLinearOpWithSolve::solveSupportsSolveMeasureTypeImpl
bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
Definition
Thyra_DefaultAdjointLinearOpWithSolve_def.hpp:126
Thyra::DefaultAdjointLinearOpWithSolve::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_DefaultAdjointLinearOpWithSolve_def.hpp:102
Thyra::LinearOpWithSolveBase
Base class for all linear operators that can support a high-level solve operation.
Definition
Thyra_LinearOpWithSolveBase_decl.hpp:279
Thyra::MultiVectorBase
Interface for a collection of column vectors called a multi-vector.
Definition
Thyra_MultiVectorBase_decl.hpp:464
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Thyra::SolveCriteria
Simple struct that defines the requested solution criteria for a solve.
Definition
Thyra_SolveSupportTypes.hpp:280
Thyra::SolveMeasureType
Solve tolerance type.
Definition
Thyra_SolveSupportTypes.hpp:80
Thyra::SolveStatus
Simple struct for the return status from a solve.
Definition
Thyra_SolveSupportTypes.hpp:391
Generated by
1.17.0