Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DefaultMultiVectorLinearOpWithSolve_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_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_DECL_HPP
11 #define THYRA_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_DECL_HPP
12 
13 
14 #include "Thyra_LinearOpWithSolveBase.hpp"
15 #include "Thyra_DefaultDiagonalLinearOp.hpp"
16 #include "Thyra_LinearOpWithSolveBase.hpp"
17 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
18 #include "Teuchos_ConstNonconstObjectContainer.hpp"
19 
20 
21 namespace Thyra {
22 
23 
29 template<class Scalar>
31  : virtual public LinearOpWithSolveBase<Scalar>
32 {
33 public:
34 
37 
40 
42  void nonconstInitialize(
43  const RCP<LinearOpWithSolveBase<Scalar> > &lows,
44  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
45  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
46  );
47 
49  void initialize(
50  const RCP<const LinearOpWithSolveBase<Scalar> > &lows,
51  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
52  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
53  );
54 
58 
61  getLinearOpWithSolve() const;
62 
63  // 2007/05/24: rabartl: ToDo: Add a const version of the above function once
64  // needed
65 
67  void uninitialize();
68 
70 
73 
76 
79 
82 
84 
85 protected:
86 
90  bool opSupportedImpl(EOpTransp M_trans) const;
92  void applyImpl(
93  const EOpTransp M_trans,
94  const MultiVectorBase<Scalar> &X,
95  const Ptr<MultiVectorBase<Scalar> > &Y,
96  const Scalar alpha,
97  const Scalar beta
98  ) const;
100 
104  bool solveSupportsImpl(EOpTransp M_trans) const;
107  EOpTransp M_trans, const SolveMeasureType& solveMeasureType) const;
110  const EOpTransp transp,
111  const MultiVectorBase<Scalar> &B,
112  const Ptr<MultiVectorBase<Scalar> > &X,
113  const Ptr<const SolveCriteria<Scalar> > solveCriteria
114  ) const;
116 
117 private:
118 
119  // //////////////////////////////
120  // Private types
121 
123 
124  // //////////////////////////////
125  // Private data members
126 
127  CNLOWS lows_;
130 
131  // //////////////////////////////
132  // Private member functions
133 
134  static void validateInitialize(
135  const RCP<const LinearOpWithSolveBase<Scalar> > &lows,
136  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
137  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
138  );
139 
140 
141 };
142 
143 
148 template<class Scalar>
151 {
153 }
154 
155 
160 template<class Scalar>
163  const RCP<LinearOpWithSolveBase<Scalar> > &lows,
164  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
165  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
166  )
167 {
170  mvlows->nonconstInitialize(lows,multiVecRange,multiVecDomain);
171  return mvlows;
172 }
173 
174 
179 template<class Scalar>
182  const RCP<const LinearOpWithSolveBase<Scalar> > &lows,
183  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
184  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
185  )
186 {
189  mvlows->initialize(lows,multiVecRange,multiVecDomain);
190  return mvlows;
191 }
192 
193 
194 } // end namespace Thyra
195 
196 
197 #endif // THYRA_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_DECL_HPP
Implicit concrete LinearOpWithSolveBase subclass that takes a flattended out multi-vector and perform...
Base class for all linear operators that can support a high-level solve operation.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< const LinearOpWithSolveBase< Scalar > > getLinearOpWithSolve() const
Interface for a collection of column vectors called a multi-vector.
void nonconstInitialize(const RCP< LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Simple struct for the return status from a solve.
Standard concrete implementation of a product vector space that creates product vectors fromed implic...
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
RCP< DefaultMultiVectorLinearOpWithSolve< Scalar > > nonconstMultiVectorLinearOpWithSolve(const RCP< LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Nonmember constructor function.
RCP< DefaultMultiVectorLinearOpWithSolve< Scalar > > multiVectorLinearOpWithSolve()
Nonmember constructor function.
Simple struct that defines the requested solution criteria for a solve.
RCP< DefaultMultiVectorLinearOpWithSolve< Scalar > > multiVectorLinearOpWithSolve(const RCP< const LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Nonmember constructor function.
bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
void initialize(const RCP< const LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)