Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_SpmdVectorBase.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_SPMD_VECTOR_BASE_DECL_HPP
11 #define THYRA_SPMD_VECTOR_BASE_DECL_HPP
12 
13 
14 #include "Thyra_VectorBase.hpp"
15 #include "Thyra_SpmdMultiVectorBase.hpp"
16 
17 
18 namespace Thyra {
19 
20 
33 template<class Scalar>
35  virtual public VectorBase<Scalar>,
36  virtual public SpmdMultiVectorBase<Scalar>
37 {
38 public:
39 
44 
47 
51  { return getNonconstLocalSubVectorImpl(); }
52 
56  { return getLocalSubVectorImpl(); }
57 
75  void getNonconstLocalData(const Ptr<ArrayRCP<Scalar> > &localValues)
76  { this->getNonconstLocalVectorDataImpl(localValues); }
77 
95  void getLocalData(const Ptr<ArrayRCP<const Scalar> > &localValues) const
96  { this->getLocalVectorDataImpl(localValues); }
97 
99 
100 protected:
101 
104 
108 
111  getLocalSubVectorImpl() const = 0;
112 
114  virtual void getNonconstLocalVectorDataImpl(
115  const Ptr<ArrayRCP<Scalar> > &localValues) = 0;
116 
118  virtual void getLocalVectorDataImpl(
119  const Ptr<ArrayRCP<const Scalar> > &localValues) const = 0;
120 
122 
123 
124 }; // end class SpmdVectorBase
125 
126 
127 } // end namespace Thyra
128 
129 
130 #endif // THYRA_SPMD_VECTOR_BASE_DECL_HPP
Base interface class for SPMD multi-vectors.
Base class for SPMD vectors that can provide views of contiguous elements in a process.
virtual RTOpPack::SubVectorView< Scalar > getNonconstLocalSubVectorImpl()=0
Virtual implementation for getNonconstLocalSubVector().
RTOpPack::ConstSubVectorView< Scalar > getLocalSubVector() const
Get a const generalized view of local vector data.
virtual RTOpPack::ConstSubVectorView< Scalar > getLocalSubVectorImpl() const =0
Virtual implementation for getLocalSubVector().
RTOpPack::SubVectorView< Scalar > getNonconstLocalSubVector()
Get a non-const generalized view of local vector data.
Abstract interface for finite-dimensional dense vectors.
void getLocalData(const Ptr< ArrayRCP< const Scalar > > &localValues) const
Returns a const pointer to the beginning of the local vector data.
virtual void getNonconstLocalVectorDataImpl(const Ptr< ArrayRCP< Scalar > > &localValues)=0
Implementation of getNonconstLocalData()
virtual void getLocalVectorDataImpl(const Ptr< ArrayRCP< const Scalar > > &localValues) const =0
Implementation of getLocalData()
void getNonconstLocalData(const Ptr< ArrayRCP< Scalar > > &localValues)
Returns a non-const pointer to the beginning of the local vector data.