Thyra Version of the Day
Loading...
Searching...
No Matches
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
21namespace Thyra {
22
23
24// Constructors, initializers, accessors
25
26
27template<class Scalar>
30
31
32template<class Scalar>
38
39
40template<class Scalar>
42 const Teuchos::RCP<const LinearOpBase<Scalar> > &op_in
43 )
44{
45#ifdef TEUCHOS_DEBUG
46 TEUCHOS_TEST_FOR_EXCEPT(is_null(op_in));
47#endif
48 op_ = op_in;
49}
50
51
52template<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
65template<class Scalar>
67{
68 return false;
69}
70
71
72template<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
85template<class Scalar>
88{
89 return op_;
90}
91
92
93} // end namespace Thyra
94
95
96#endif // THYRA_LINEAR_OP_SCALAR_PROD_DEF_HPP
Ptr< T > ptr() const
Base class for all linear operators.
void apply(const LinearOpBase< Scalar > &M, const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha=static_cast< Scalar >(1.0), const Scalar beta=static_cast< Scalar >(0.0))
Non-member function call for M.apply(...).
virtual RCP< const VectorSpaceBase< Scalar > > range() const =0
Return a smart pointer for the range space for this operator.
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const
RCP< const LinearOpBase< Scalar > > getLinearOpImpl() const
void uninitialize(const Ptr< RCP< const LinearOpBase< Scalar > > > &op=Teuchos::null)
void initialize(const RCP< const LinearOpBase< Scalar > > &op)
virtual bool isEuclideanImpl() const
Returns false.
Interface for a collection of column vectors called a multi-vector.
void dots(const MultiVectorBase< Scalar > &V1, const MultiVectorBase< Scalar > &V2, const ArrayView< Scalar > &dots)
Multi-vector dot product.
RCP< MultiVectorBase< Scalar > > createMembers(const RCP< const VectorSpaceBase< Scalar > > &vs, int numMembers, const std::string &label="")
Create a set of vector members (a MultiVectorBase) from the vector space.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
NOTRANS
Type for the dimension of a vector space. `**/ typedef Teuchos::Ordinal Ordinal;.