42 #ifndef THYRA_DEFAULT_SPMD_VECTOR_SPACE_DEF_HPP
43 #define THYRA_DEFAULT_SPMD_VECTOR_SPACE_DEF_HPP
45 #include "Thyra_DefaultSpmdVectorSpace_decl.hpp"
46 #include "Thyra_SpmdVectorSpaceDefaultBase.hpp"
47 #include "Thyra_VectorSpaceFactoryBase.hpp"
48 #include "Thyra_DefaultSpmdMultiVector.hpp"
49 #include "Thyra_DefaultSpmdVector.hpp"
50 #include "Teuchos_CommHelpers.hpp"
56 template<
class Scalar>
57 RCP<DefaultSpmdVectorSpace<Scalar> >
66 template<
class Scalar>
71 this->initialize(Teuchos::null, dim_in, dim_in);
75 template<
class Scalar>
79 const bool isLocallyReplicated_in
86 localSubDim_ = localSubDim_in;
87 if (! comm.is_null ()) {
88 numProc_ = comm->getSize ();
89 procRank_ = comm->getRank ();
95 this->updateState(globalDim, isLocallyReplicated_in);
99 template<
class Scalar>
102 comm_ = Teuchos::null;
110 template<
class Scalar>
116 values = Teuchos::arcp<Scalar>(localSubDim_);
119 weakSelfPtr_.create_strong(),
127 template<
class Scalar>
133 weakSelfPtr_.create_strong(),
135 this->smallVecSpcFcty()->createVecSpc(numMembers),true
142 template<
class Scalar>
153 weakSelfPtr_.create_strong(),
161 template<
class Scalar>
172 weakSelfPtr_.create_strong(),
173 Teuchos::arcp(const_cast<Scalar*>(raw_v.
values().
get()),0,raw_v.
subDim(),
false),
180 template<
class Scalar>
191 weakSelfPtr_.create_strong(),
193 this->smallVecSpcFcty()->createVecSpc(raw_mv.
numSubCols()),
true),
201 template<
class Scalar>
212 weakSelfPtr_.create_strong(),
214 this->smallVecSpcFcty()->createVecSpc(raw_mv.
numSubCols()),
true),
216 const_cast<Scalar*>(raw_mv.
values().
get()),
224 template<
class Scalar>
229 const Range1D rng = full_range(rng_in,0,this->dim()-1);
230 const Ordinal l_localOffset = this->localOffset();
231 return ( l_localOffset<=rng.
lbound() && rng.
ubound()<l_localOffset+localSubDim_ );
235 template<
class Scalar>
239 return defaultSpmdVectorSpace<Scalar>(comm_, localSubDim_, this->dim(),
240 this->isLocallyReplicated());
247 template<
class Scalar>
255 template<
class Scalar>
265 template<
class Scalar>
267 :localSubDim_(-1), numProc_(-1), procRank_(-1)
277 #endif // THYRA_DEFAULT_SPMD_VECTOR_SPACE_DEF_HPP
Ordinal numSubCols() const
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Returns true if all the elements in rng are in this process.
RCP< T > create_weak() const
RCP< MultiVectorBase< Scalar > > createMembersView(const RTOpPack::SubMultiVectorView< Scalar > &raw_mv) const
const ArrayRCP< Scalar > values() const
RCP< const Teuchos::Comm< Ordinal > > getComm() const
EViewType
Determines if a view is a direct view of data or a detached copy of data.
RCP< const VectorSpaceBase< Scalar > > clone() const
Ordinal localSubDim() const
const ArrayRCP< Scalar > values() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Ordinal leadingDim() const
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
void uninitialize()
Set to an uninitialized state.
RCP< VectorBase< Scalar > > createMember() const
Concrete implementation of an SPMD vector space subclass which creates DefaultSpmdVector and DefaultS...
void initialize(const Ordinal dim)
Initialize a serial space.
Efficient concrete implementation subclass for SPMD vectors.
const ArrayRCP< const Scalar > values() const
RCP< VectorBase< Scalar > > createMemberView(const RTOpPack::SubVectorView< Scalar > &raw_v) const
Efficient concrete implementation subclass for SPMD multi-vectors.
EStrideType
Determine if data is unit stride or non-unit stride.
static RCP< DefaultSpmdVectorSpace< Scalar > > create()
Create with weak ownership to self.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const ArrayRCP< const Scalar > values() const