Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearOpScalarProd_def.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_LINEAR_OP_SCALAR_PROD_DEF_HPP
11 #define THYRA_LINEAR_OP_SCALAR_PROD_DEF_HPP
12 
13 #include "Thyra_LinearOpScalarProd_decl.hpp"
14 #include "Thyra_ScalarProdBase.hpp"
15 #include "Thyra_LinearOpBase.hpp"
16 #include "Thyra_MultiVectorStdOps.hpp"
17 #include "Thyra_MultiVectorBase.hpp"
18 #include "Thyra_VectorSpaceBase.hpp"
19 
20 
21 namespace Thyra {
22 
23 
24 // Constructors, initializers, accessors
25 
26 
27 template<class Scalar>
29 {}
30 
31 
32 template<class Scalar>
34  const Teuchos::RCP<const LinearOpBase<Scalar> > &op_in )
35 {
36  this->initialize(op_in);
37 }
38 
39 
40 template<class Scalar>
42  const Teuchos::RCP<const LinearOpBase<Scalar> > &op_in
43  )
44 {
45 #ifdef TEUCHOS_DEBUG
47 #endif
48  op_ = op_in;
49 }
50 
51 
52 template<class Scalar>
54  const Ptr<RCP<const LinearOpBase<Scalar> > > &op_out
55  )
56 {
57  if (!is_null(op_out)) *op_out = op_;
58  op_ = Teuchos::null;
59 }
60 
61 
62 // Overridden from ScalarProdBase
63 
64 
65 template<class Scalar>
67 {
68  return false;
69 }
70 
71 
72 template<class Scalar>
75  const ArrayView<Scalar> &scalarProds_out
76  ) const
77 {
79  T = createMembers(Y.range() ,Y.domain()->dim());
80  Thyra::apply(*op_, NOTRANS,Y, T.ptr());
81  dots(X, *T, scalarProds_out);
82 }
83 
84 
85 template<class Scalar>
88 {
89  return op_;
90 }
91 
92 
93 } // end namespace Thyra
94 
95 
96 #endif // THYRA_LINEAR_OP_SCALAR_PROD_DEF_HPP
void initialize(int *argc, char ***argv)
void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const
bool is_null(const boost::shared_ptr< T > &p)
virtual RCP< const VectorSpaceBase< Scalar > > range() const =0
Return a smart pointer for the range space for this operator.
RCP< const LinearOpBase< Scalar > > getLinearOpImpl() const
Use the non-transposed operator.
Interface for a collection of column vectors called a multi-vector.
void initialize(const RCP< const LinearOpBase< Scalar > > &op)
Ptr< T > ptr() const
virtual bool isEuclideanImpl() const
Returns false.
Base class for all linear operators.
void uninitialize(const Ptr< RCP< const LinearOpBase< Scalar > > > &op=Teuchos::null)
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)