Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DefaultMultipliedLinearOp_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_MULTIPLIED_LINEAR_OP_DECL_HPP
11 #define THYRA_DEFAULT_MULTIPLIED_LINEAR_OP_DECL_HPP
12 
13 #include "Thyra_MultipliedLinearOpBase.hpp"
14 #include "Teuchos_ConstNonconstObjectContainer.hpp"
15 
16 
17 namespace Thyra {
18 
19 
87 template<class Scalar>
88 class DefaultMultipliedLinearOp : virtual public MultipliedLinearOpBase<Scalar>
89 {
90 public:
91 
94 
102 
120  void initialize(const ArrayView<const RCP<LinearOpBase<Scalar> > > &Ops);
121 
139  void initialize(const ArrayView<const RCP<const LinearOpBase<Scalar> > > &Ops );
140 
147  void uninitialize();
148 
150 
153 
155  int numOps() const;
157  bool opIsConst(const int k) const;
161  RCP<const LinearOpBase<Scalar> > getOp(const int k) const;
162 
164 
167 
172 
177 
180 
182 
185 
189  std::string description() const;
190 
198  void describe(
200  const Teuchos::EVerbosityLevel verbLevel
201  ) const;
202 
204 
205 protected:
206 
209 
213  bool opSupportedImpl(EOpTransp M_trans) const;
214 
216  void applyImpl(
217  const EOpTransp M_trans,
218  const MultiVectorBase<Scalar> &X,
219  const Ptr<MultiVectorBase<Scalar> > &Y,
220  const Scalar alpha,
221  const Scalar beta
222  ) const;
223 
225 
226 public:
227 
228 private:
229 
231 
232  inline void assertInitialized() const;
233  inline std::string getClassName() const;
234  inline Ordinal getRangeDim() const;
235  inline Ordinal getDomainDim() const;
236 
237  void validateOps();
238  void setupDefaultObjectLabel();
239 
240  // Not defined and not to be called
243 
244 };
245 
246 
251 template<class Scalar>
252 inline
255 {
257 }
258 
259 
264 template<class Scalar>
267 {
268  RCP<DefaultMultipliedLinearOp<Scalar> > dmlo = defaultMultipliedLinearOp<Scalar>();
269  dmlo->initialize(Ops);
270  return dmlo;
271 }
272 
273 
278 template<class Scalar>
281 {
282  RCP<DefaultMultipliedLinearOp<Scalar> > dmlo = defaultMultipliedLinearOp<Scalar>();
283  dmlo->initialize(Ops);
284  return dmlo;
285 }
286 
287 
293 template<class Scalar>
295 nonconstMultiply(
296  const RCP<LinearOpBase<Scalar> > &A,
297  const RCP<LinearOpBase<Scalar> > &B,
298  const std::string &M_label = ""
299  );
300 
301 
307 template<class Scalar>
309 multiply(
310  const RCP<const LinearOpBase<Scalar> > &A,
311  const RCP<const LinearOpBase<Scalar> > &B,
312  const std::string &M_label = ""
313  );
314 
315 
321 template<class Scalar>
323 multiply(
324  const RCP<const LinearOpBase<Scalar> > &A,
325  const RCP<const LinearOpBase<Scalar> > &B,
326  const RCP<const LinearOpBase<Scalar> > &C,
327  const std::string &M_label = ""
328  );
329 
330 
331 } // end namespace Thyra
332 
333 
334 #endif // THYRA_DEFAULT_MULTIPLIED_LINEAR_OP_DECL_HPP
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns this-&gt;getOp(this-&gt;numOps()-1).domain() if &lt;t&gt;this-&gt;numOps() &gt; 0 and returns Teuchos::null oth...
DefaultMultipliedLinearOp()
Constructs to uninitialized.
RCP< DefaultMultipliedLinearOp< Scalar > > defaultMultipliedLinearOp(const ArrayView< const RCP< const LinearOpBase< Scalar > > > &Ops)
Nonmember constructor.
RCP< DefaultMultipliedLinearOp< Scalar > > defaultMultipliedLinearOp()
Nonmember constructor.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints the details about the constituent linear operators.
void initialize(const ArrayView< const RCP< LinearOpBase< Scalar > > > &Ops)
Initialize given a list of non-const linear operators.
Interface class for implicitly multiplied linear operators.
bool opSupportedImpl(EOpTransp M_trans) const
Returns true only if all constituent operators support M_trans.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Interface for a collection of column vectors called a multi-vector.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< LinearOpBase< Scalar > > getNonconstOp(const int k)
Concrete composite LinearOpBase subclass that creates an implicitly multiplied linear operator out of...
RCP< DefaultMultipliedLinearOp< Scalar > > defaultMultipliedLinearOp(const ArrayView< const RCP< LinearOpBase< Scalar > > > &Ops)
Nonmember constructor.
Base class for all linear operators.
std::string description() const
Prints just the name DefaultMultipliedLinearOp along with the overall dimensions and the number of co...
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
RCP< const LinearOpBase< Scalar > > getOp(const int k) const
RCP< const VectorSpaceBase< Scalar > > range() const
Returns this-&gt;getOp(0).range() if &lt;t&gt;this-&gt;numOps() &gt; 0 and returns Teuchos::null otherwise...