Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_ProductVectorBase.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_PRODUCT_VECTOR_BASE_HPP
11 #define THYRA_PRODUCT_VECTOR_BASE_HPP
12 
13 
14 #include "Thyra_ProductMultiVectorBase.hpp"
15 
16 
17 namespace Thyra {
18 
19 
54 template<class Scalar>
56  : virtual public VectorBase<Scalar>
57  , virtual public ProductMultiVectorBase<Scalar>
58 {
59 public:
60 
82  virtual RCP<VectorBase<Scalar> >
83  getNonconstVectorBlock(const int k) = 0;
84 
97  getVectorBlock(const int k) const = 0;
98 
99 private:
100 
101  // Not defined and not to be called
103  operator=(const ProductVectorBase<Scalar>&);
104 
105 };
106 
107 
113 template<class Scalar>
114 inline
117  const RCP<Thyra::VectorBase<Scalar> > &v
118  )
119 {
120  return Teuchos::rcp_dynamic_cast<Thyra::ProductVectorBase<Scalar> >(v, true);
121 }
122 
123 
129 template<class Scalar>
130 inline
133  const RCP<const Thyra::VectorBase<Scalar> > &v
134  )
135 {
136  return Teuchos::rcp_dynamic_cast<const Thyra::ProductVectorBase<Scalar> >(v, true);
137 }
138 
139 
140 } // namespace Thyra
141 
142 #endif // THYRA_PRODUCT_VECTOR_BASE_HPP
Base interface for product multi-vectors.
Base interface for product vectors.
virtual RCP< const VectorBase< Scalar > > getVectorBlock(const int k) const =0
Returns a non-persisting const view of the (zero-based) kth block vector.
virtual RCP< VectorBase< Scalar > > getNonconstVectorBlock(const int k)=0
Returns a non-persisting non-const view of the (zero-based) kth block vector.
RCP< const Thyra::ProductVectorBase< Scalar > > productVectorBase(const RCP< const Thyra::VectorBase< Scalar > > &v)
Dynamic cast from a const VectorBase to a const ProductVectorBase object and thow exception if this f...
Abstract interface for finite-dimensional dense vectors.
RCP< Thyra::ProductVectorBase< Scalar > > nonconstProductVectorBase(const RCP< Thyra::VectorBase< Scalar > > &v)
Dynamic cast from a VectorBase to a ProductVectorBase object and thow exception if this fails...