Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
28 {
29 public:
30 
33 
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 
47 
50 
52 
55 
60 
62 
63 protected:
64 
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 
82  bool solveSupportsImpl(EOpTransp M_trans) const;
85  EOpTransp M_trans, const SolveMeasureType& solveMeasureType) const;
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 
101  CNCLOWS;
102 
103  // /////////////////////////
104  // Private data members
105 
106  CNCLOWS lows_;
107  EOpTransp transp_;
108 
109 };
110 
111 
116 template<class Scalar>
118 defaultAdjointLinearOpWithSolve(
119  const RCP<const LinearOpWithSolveBase<Scalar> > &lows,
120  const EOpTransp transp )
121 {
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
bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
Base class for all linear operators that can support a high-level solve operation.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
Default concreate decorator subclass for a transpose/adjoint LinearOpWithSolveBase object...
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
const RCP< const LinearOpWithSolveBase< Scalar > > getOp() const
Get the const underlying LOWSB object.
RCP< const VectorSpaceBase< Scalar > > range() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Interface for a collection of column vectors called a multi-vector.
const RCP< LinearOpWithSolveBase< Scalar > > getNonconstOp()
Get the non-const underlying LOWSB object.
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
Simple struct for the return status from a solve.
RCP< const VectorSpaceBase< Scalar > > domain() const
Simple struct that defines the requested solution criteria for a solve.
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
void initialize(const RCP< LinearOpWithSolveBase< Scalar > > &lows, const EOpTransp transp)
Initialize with non-const LOWSB .