Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DiagonalScalarProd_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_DIAGONAL_SCALAR_PROD_DECL_HPP
11 #define THYRA_DIAGONAL_SCALAR_PROD_DECL_HPP
12 
13 
14 #include "Thyra_ScalarProdBase.hpp"
15 
16 
17 namespace Thyra {
18 
19 
26 template<class Scalar>
27 class DiagonalScalarProd : public ScalarProdBase<Scalar> {
28 public:
29 
32 
35 
37  void initialize( const RCP<const VectorBase<Scalar> > &s_diag );
38 
40 
41 protected:
42 
45 
47  virtual bool isEuclideanImpl() const;
48 
50  virtual void scalarProdsImpl(
52  const ArrayView<Scalar> &scalarProds_out ) const;
53 
56 
58 
59 private:
60 
62 
63 };
64 
65 
70 template<class Scalar>
73 {
74  const RCP<DiagonalScalarProd<Scalar> > scalarProd =
76  scalarProd->initialize(s_diag);
77  return scalarProd;
78 }
79 
80 
81 
82 } // end namespace Thyra
83 
84 
85 #endif // THYRA_DIAGONAL_SCALAR_PROD_DECL_HPP
Concrete implementation of a scalar product using a diagonal vector.
virtual void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const
virtual bool isEuclideanImpl() const
Returns false.
RCP< const LinearOpBase< Scalar > > getLinearOpImpl() 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.
Abstract interface for finite-dimensional dense vectors.
RCP< DiagonalScalarProd< Scalar > > diagonalScalarProd(const RCP< const VectorBase< Scalar > > &s_diag)
Nonmember constructor.
void initialize(const RCP< const VectorBase< Scalar > > &s_diag)
Abstract interface for scalar products.