42 #ifndef THYRA_DEFAULT_PRODUCT_VECTOR_SPACE_DECL_HPP
43 #define THYRA_DEFAULT_PRODUCT_VECTOR_SPACE_DECL_HPP
45 #include "Thyra_ProductVectorSpaceBase.hpp"
46 #include "Thyra_VectorSpaceDefaultBase.hpp"
47 #include "Teuchos_implicit_cast.hpp"
135 template<
class Scalar>
136 class DefaultProductVectorSpace
137 :
virtual public ProductVectorSpaceBase<Scalar>,
138 virtual protected VectorSpaceDefaultBase<Scalar>
150 const ArrayView<
const RCP<
const VectorSpaceBase<Scalar> > > &
vecSpaces
192 const ArrayView<
const RCP<
const VectorSpaceBase<Scalar> > > &
vecSpaces
224 const ArrayView<RCP<
const VectorSpaceBase<Scalar> > > &
vecSpaces = Teuchos::null
235 virtual const RCP<const VectorSpaceBase<Scalar> >*
vecSpaces()
const;
285 RCP<const VectorSpaceBase<Scalar> >
getBlock(
const int k)
const;
298 bool isCompatible(
const VectorSpaceBase<Scalar>& vecSpc )
const;
307 const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y )
const;
313 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y,
326 RCP< MultiVectorBase<Scalar> >
createMembers(
int numMembers)
const;
329 RCP< const VectorSpaceBase<Scalar> >
clone()
const;
365 typedef Array<RCP<const VectorSpaceBase<Scalar> > > vecSpaces_t;
366 typedef Array<Ordinal> vecSpacesOffsets_t;
372 RCP<vecSpaces_t> vecSpaces_;
373 RCP<vecSpacesOffsets_t> vecSpacesOffsets_;
381 void assertInitialized()
const;
390 template<
class Scalar>
392 RCP<DefaultProductVectorSpace<Scalar> >
403 template<
class Scalar>
419 template<
class Scalar>
428 for (
int i = 0; i < numBlocks; ++i )
430 return productVectorSpace<Scalar>(vecSpaceBlocks());
438 template<
class Scalar>
442 return ( dim_ ? &(*vecSpaces_)[0] : NULL );
446 template<
class Scalar>
450 return ( dim_ ? &(*vecSpacesOffsets_)[0] : NULL );
454 template<
class Scalar>
457 return vecSpaces_.strong_count() > 1;
461 template<
class Scalar>
475 #endif // THYRA_DEFAULT_PRODUCT_VECTOR_SPACE_DECL_HPP
RCP< DefaultProductVectorSpace< Scalar > > productVectorSpace(const ArrayView< RCP< const VectorSpaceBase< Scalar > > > &vecSpaces)
Nonmember constructor that takes an array of vector spaces.
RCP< const VectorSpaceBase< Scalar > > getBlock(const int k) const
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Returns true if all of the constituent vector spaces return true.
RCP< const VectorSpaceBase< Scalar > > clone() const
Clones the object as promised.
bool is_null(const boost::shared_ptr< T > &p)
Ordinal dim() const
Returns the summation of the constituent vector spaces.
RCP< DefaultProductVectorSpace< Scalar > > productVectorSpace()
Nonmember constructor that constructs to uninitialized.
Scalar scalarProd(const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const
Returns the sum of the scalar products of the constituent vectors.
bool hasBeenCloned() const
Return if this vector space was cloned.
RCP< const VectorSpaceFactoryBase< Scalar > > smallVecSpcFcty() const
Returns getBlock(0)->smallVecSpcFcty().
Abstract interface for objects that represent a space for vectors.
EViewType
Determines if a view is a direct view of data or a detached copy of data.
RCP< DefaultProductVectorSpace< Scalar > > productVectorSpace(const RCP< const VectorSpaceBase< Scalar > > &vecSpace, const int numBlocks)
Nonmember constructor that duplicates a block vector space numBlock times to form a product space...
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 DefaultProductVector object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
virtual void uninitialize(const ArrayView< RCP< const VectorSpaceBase< Scalar > > > &vecSpaces=Teuchos::null)
Uninitialize.
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
Returns a DefaultProductMultiVector object.
virtual void initialize(const ArrayView< const RCP< const VectorSpaceBase< Scalar > > > &vecSpaces)
Initialize with a list of constituent vector spaces.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints the details about the constituent vector spaces.
TypeTo implicit_cast(const TypeFrom &t)
void getVecSpcPoss(Ordinal i, int *kth_vector_space, Ordinal *kth_global_offset) const
Get the position of the vector space object and its offset into a composite vector that owns the ith ...
void push_back(const value_type &x)
bool isCompatible(const VectorSpaceBase< Scalar > &vecSpc) const
Returns true only if also a product vector space and all constituent vectors are compatible.
EStrideType
Determine if data is unit stride or non-unit stride.
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.
virtual const RCP< const VectorSpaceBase< Scalar > > * vecSpaces() const
Returns a pointer to an array (of length this->numBlocks()) to the constituent vector spaces...
std::string description() const
Prints just the name DefaultProductVectorSpace along with the overall dimension and the number of blo...
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
virtual const Ordinal * vecSpacesOffsets() const
Returns a pointer to an array (of length this->numBlocks()+1) of offset into each constituent vector ...
DefaultProductVectorSpace()
Default construct to uninitialized.