42 #ifndef THYRA_VECTOR_SPACE_BASE_DEF_HPP
43 #define THYRA_VECTOR_SPACE_BASE_DEF_HPP
45 #include "Thyra_VectorSpaceBase_decl.hpp"
46 #include "Thyra_VectorBase.hpp"
47 #include "Thyra_MultiVectorBase.hpp"
48 #include "Teuchos_Tuple.hpp"
52 # define THYRA_INITIALIZE_VECS_MULTIVECS_WITH_NANS
68 template<
class Scalar>
75 template<
class Scalar>
83 template<
class Scalar>
99 template<
class Scalar>
101 Thyra::makeHaveOwnership(
const RCP<
const VectorSpaceBase<Scalar> > &vs_in )
103 if (vs_in.has_ownership())
105 const RCP<const VectorSpaceBase<Scalar> > vs = vs_in->clone();
108 ,
"Thyra::makeHaveOwnership(vs): Error, the concrete VectorSpaceBase object identified as \'"
109 << vs->description() <<
"\' does not support the clone() function!"
115 template<
class Scalar>
118 const RCP<
const VectorSpaceBase<Scalar> > &vs,
119 const std::string &label
122 RCP<VectorBase<Scalar> > v = vs->createMember();
123 #ifdef THYRA_INITIALIZE_VECS_MULTIVECS_WITH_NANS
129 Teuchos::outArg(v) );
130 if (label.length()) v->setObjectLabel(label);
135 template<
class Scalar>
138 const VectorSpaceBase<Scalar> &vs,
const std::string &label
145 template<
class Scalar>
147 Thyra::createMembers(
148 const RCP<
const VectorSpaceBase<Scalar> > &vs,
149 int numMembers,
const std::string &label
152 RCP<MultiVectorBase<Scalar> >
153 mv = vs->createMembers(numMembers);
154 #ifdef THYRA_INITIALIZE_VECS_MULTIVECS_WITH_NANS
160 Teuchos::outArg(mv));
161 if(label.length()) mv->setObjectLabel(label);
166 template<
class Scalar>
168 Thyra::createMembers(
169 const RCP<
const VectorSpaceBase<Scalar> > &vs,
170 const RCP<
const VectorSpaceBase<Scalar> > &domain,
171 const std::string &label
178 template<
class Scalar>
180 Thyra::createMembers(
181 const VectorSpaceBase<Scalar> &vs,
int numMembers,
182 const std::string &label
189 template<
class Scalar>
191 Thyra::createMemberView(
192 const RCP<
const VectorSpaceBase<Scalar> > &vs,
194 const std::string &label
197 RCP<VectorBase<Scalar> >
198 v = vs->createMemberView(raw_v);
200 Teuchos::outArg(v) );
201 if (label.length()) v->setObjectLabel(label);
206 template<
class Scalar>
208 Thyra::createMemberView(
209 const VectorSpaceBase<Scalar> &vs,
211 const std::string &label
218 template<
class Scalar>
220 Thyra::createMemberView(
221 const RCP<
const VectorSpaceBase<Scalar> > &vs,
223 const std::string &label
226 RCP<const VectorBase<Scalar> >
227 v = vs->createMemberView(raw_v);
229 Teuchos::outArg(v) );
231 Teuchos::rcp_const_cast<VectorBase<Scalar> >(v)->setObjectLabel(label);
236 template<
class Scalar>
238 Thyra::createMemberView(
239 const VectorSpaceBase<Scalar> &vs,
241 const std::string &label
248 template<
class Scalar>
250 Thyra::createMembersView(
251 const RCP<
const VectorSpaceBase<Scalar> > &vs,
253 const std::string &label
256 RCP<MultiVectorBase<Scalar> >
257 mv = vs->createMembersView(raw_mv);
259 Teuchos::outArg(mv) );
260 if (label.length()) mv->setObjectLabel(label);
265 template<
class Scalar>
267 Thyra::createMembersView(
268 const VectorSpaceBase<Scalar> &vs,
270 const std::string &label
277 template<
class Scalar>
279 Thyra::createMembersView(
280 const RCP<
const VectorSpaceBase<Scalar> > &vs,
282 const std::string &label
285 RCP<const MultiVectorBase<Scalar> >
286 mv = vs->createMembersView(raw_mv);
288 Teuchos::outArg(mv) );
290 Teuchos::rcp_const_cast<MultiVectorBase<Scalar> >(mv)->setObjectLabel(label);
295 template<
class Scalar>
297 Thyra::createMembersView(
const VectorSpaceBase<Scalar> &vs,
299 const std::string &label
314 #define THYRA_VECTOR_SPACE_BASE_INSTANT(SCALAR) \
316 template class VectorSpaceBase<SCALAR >; \
318 template RCP< VectorBase<SCALAR > > \
320 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
321 const std::string &label \
324 template RCP< VectorBase<SCALAR > > \
326 const VectorSpaceBase<SCALAR > &vs, const std::string &label \
329 template RCP< MultiVectorBase<SCALAR > > \
331 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
332 int numMembers, const std::string &label \
335 template RCP< Thyra::MultiVectorBase<SCALAR > > \
337 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
338 const RCP<const VectorSpaceBase<SCALAR > > &domain, \
339 const std::string &label \
342 template RCP< MultiVectorBase<SCALAR > > \
344 const VectorSpaceBase<SCALAR > &vs, int numMembers, \
345 const std::string &label \
348 template RCP<VectorBase<SCALAR > > \
350 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
351 const RTOpPack::SubVectorView<SCALAR > &raw_v, \
352 const std::string &label \
355 template RCP<VectorBase<SCALAR > > \
357 const VectorSpaceBase<SCALAR > &vs, \
358 const RTOpPack::SubVectorView<SCALAR > &raw_v, \
359 const std::string &label \
362 template RCP<const VectorBase<SCALAR > > \
364 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
365 const RTOpPack::ConstSubVectorView<SCALAR > &raw_v, \
366 const std::string &label \
369 template RCP<const VectorBase<SCALAR > > \
371 const VectorSpaceBase<SCALAR > &vs, \
372 const RTOpPack::ConstSubVectorView<SCALAR > &raw_v, \
373 const std::string &label \
376 template RCP<MultiVectorBase<SCALAR > > \
378 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
379 const RTOpPack::SubMultiVectorView<SCALAR > &raw_mv, \
380 const std::string &label \
383 template RCP<MultiVectorBase<SCALAR > > \
385 const VectorSpaceBase<SCALAR > &vs, \
386 const RTOpPack::SubMultiVectorView<SCALAR > &raw_mv, \
387 const std::string &label \
390 template RCP<const MultiVectorBase<SCALAR > > \
392 const RCP<const VectorSpaceBase<SCALAR > > &vs, \
393 const RTOpPack::ConstSubMultiVectorView<SCALAR > &raw_mv, \
394 const std::string &label \
397 template RCP<const MultiVectorBase<SCALAR > > \
398 createMembersView( const VectorSpaceBase<SCALAR > &vs, \
399 const RTOpPack::ConstSubMultiVectorView<SCALAR > &raw_mv, \
400 const std::string &label \
404 #endif // THYRA_VECTOR_SPACE_BASE_DEF_HPP
bool is_null(const boost::shared_ptr< T > &p)
virtual RCP< const VectorSpaceBase< Scalar > > clone() const
Clone this object (if supported).
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
EViewType
Determines if a view is a direct view of data or a detached copy of data.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< VectorBase< Scalar > > createMemberView(const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubVectorView< Scalar > &raw_v, const std::string &label="")
Create a vector member that is a non-const view of raw data.
RCP< const VectorSpaceBase< Scalar > > makeHaveOwnership(const RCP< const VectorSpaceBase< Scalar > > &vs)
Helper function that clones a VectorSpaceBase object if the RCP does not have ownership.
RCP< VectorBase< Scalar > > createMember(const RCP< const VectorSpaceBase< Scalar > > &vs, const std::string &label="")
Create a vector member from the vector space.
EStrideType
Determine if data is unit stride or non-unit stride.
RCP< MultiVectorBase< Scalar > > createMembersView(const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, const std::string &label="")
Create a multi-vector member that is a non-const view of raw data.
RCP< MultiVectorBase< Scalar > > createMembers(const RCP< const VectorSpaceBase< Scalar > > &vs, int numMembers, const std::string &label="")
Create a set of vector members (a MultiVectorBase) from the vector space.
virtual bool hasInCoreView(const Range1D &rng=Range1D(), const EViewType viewType=VIEW_TYPE_DETACHED, const EStrideType strideType=STRIDE_TYPE_NONUNIT) const
Returns true if this->acquireDetachedView(rng,...) returns a direct view of the range of data request...
virtual bool isEuclidean() const
Return if this vector space has a Euclidean (identity) basis in which case the scalar product is the ...