Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_DefaultMultiVectorProductVectorSpace_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_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
11#define THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
12
13#include "Thyra_ProductVectorSpaceBase.hpp" // Interface
14#include "Thyra_DefaultProductVectorSpace.hpp" // Implementation
15#include "Thyra_VectorSpaceDefaultBase.hpp"
16
17
18namespace Thyra {
19
20
32template<class Scalar>
34 : virtual public ProductVectorSpaceBase<Scalar>
35 , virtual protected VectorSpaceDefaultBase<Scalar>
36{
37public:
38
41
44
64 void initialize(
65 const RCP<const VectorSpaceBase<Scalar> > &space,
66 const int numColumns
67 );
68
72
93 void uninitialize(
94 RCP<const VectorSpaceBase<Scalar> > *space = 0,
95 int *numColumns = 0
96 );
97
99
102
104 int numBlocks() const;
106 RCP<const VectorSpaceBase<Scalar> > getBlock(const int k) const;
107
109
112
114 Ordinal dim() const;
116 bool isCompatible( const VectorSpaceBase<Scalar>& vecSpc ) const;
120 Scalar scalarProd( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y ) const;
124 void scalarProdsImpl(
126 const ArrayView<Scalar> &scalarProds ) const;
130 bool hasInCoreView( const Range1D& rng, const EViewType viewType,
131 const EStrideType strideType ) const;
142 RCP< MultiVectorBase<Scalar> > createMembers(int numMembers) const;
145
147
150
154 std::string description() const;
155
163 void describe(
165 const Teuchos::EVerbosityLevel verbLevel
166 ) const;
167
169
170private:
171
172 // ///////////////////////////////////
173 // Private data members
174
176 int numColumns_;
178
179 // ///////////////////////////////////
180 // Private member functions
181
182 void assertInitialized() const;
183
184};
185
186
191template<class Scalar>
192inline
198
199
204template<class Scalar>
205inline
208 const RCP<const VectorSpaceBase<Scalar> > &space,
209 const int numColumns
210 )
211{
213 multiVectorProductVectorSpace<Scalar>();
214 multiVecProdVecSpace->initialize(space,numColumns);
215 return multiVecProdVecSpace;
216}
217
218
219// /////////////////////////////////
220// Inline members
221
222
223template<class Scalar>
224inline
230
231
232template<class Scalar>
233inline
235{
236#ifdef TEUCHOS_DEBUG
237 TEUCHOS_TEST_FOR_EXCEPT( is_null(space_) );
238#endif
239}
240
241
242} // namespace Thyra
243
244
245#endif // THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
Standard concrete implementation of a product vector space that creates product vectors fromed implic...
RCP< const DefaultProductVectorSpace< Scalar > > getDefaultProductVectorSpace() const
RCP< const VectorSpaceBase< Scalar > > clone() const
Clones the object as promised.
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
Returns a DefaultColumnwiseMultiVector object.
RCP< const VectorSpaceFactoryBase< Scalar > > smallVecSpcFcty() const
Returns getBlock(0)->smallVecSpcFcty().
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space, const int numColumns)
Initialize with a list of constituent vector spaces.
bool isCompatible(const VectorSpaceBase< Scalar > &vecSpc) const
std::string description() const
Prints just the name DefaultMultiVectorProductVectorSpace along with the overall dimension and the nu...
void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds) const
Returns the sum of the scalar products of each of the columns of the constituent multi-vectors.
RCP< VectorBase< Scalar > > createMember() const
Returns a DefaultMultiVectorProductVector object.
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Returns true if all of the constituent vector spaces return true.
Scalar scalarProd(const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const
Returns the sum of the scalar products of the constituent vectors.
void uninitialize(RCP< const VectorSpaceBase< Scalar > > *space=0, int *numColumns=0)
Uninitialize.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints the details about the constituent vector space.
RCP< const VectorSpaceBase< Scalar > > getBlock(const int k) const
RCP< DefaultMultiVectorProductVectorSpace< Scalar > > multiVectorProductVectorSpace()
Nonmember constructor function.
RCP< DefaultMultiVectorProductVectorSpace< Scalar > > multiVectorProductVectorSpace(const RCP< const VectorSpaceBase< Scalar > > &space, const int numColumns)
Nonmember constructor function.
Interface for a collection of column vectors called a multi-vector.
Abstract interface for finite-dimensional dense vectors.
Abstract interface for objects that represent a space for vectors.
void scalarProds(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const
Return the scalar product of each column in two multi-vectors in the vector space.
Node VectorSpaceBase subclass that provides default implementations for many functions using a defaul...
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
EStrideType
Determine if data is unit stride or non-unit stride.
EViewType
Determines if a view is a direct view of data or a detached copy of data.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)