44 #include "AbstractLinAlgPack_VectorSpaceSubSpace.hpp"
45 #include "AbstractLinAlgPack_VectorMutableSubView.hpp"
46 #include "Teuchos_Assert.hpp"
48 namespace AbstractLinAlgPack {
59 full_space.
get() == NULL, std::invalid_argument
60 ,
"VectorSpaceSubSpace::initialize(...): Error!" );
62 const index_type n = full_space->dim();
66 ,
"VectorSpaceSubSpace::initialize(...): Error, "
67 "rng = [" << rng.
lbound() <<
"," << rng.
ubound() <<
"] is not in the range "
68 "[1,vec->dim()] = [1," << n <<
"]" );
76 full_space_ = Teuchos::null;
83 const index_type n = this->
dim();
85 full_space_.
get() == NULL, std::logic_error
86 ,
"VectorSpaceSubSpace::validate_range(rng): Error, Uninitialized" );
89 ,
"VectorSpaceSubSpace::validate_range(rng): Error, "
90 "rng = [" << rng.
lbound() <<
"," << rng.
ubound() <<
"] is not in the range "
91 "[1,this->dim] = [1," << n <<
"]" );
106 ( this->full_space_.
get() == NULL && a_space->full_space_.
get() == NULL )
108 ( this->rng_ == a_space->rng_ && this->full_space_->is_compatible(*a_space->full_space_) );
113 return full_space_->is_in_core();
118 return full_space_.
get() ? rng_.
size() : 0;
123 namespace rcp = MemMngPack;
124 if( full_space_.
get() )
127 full_space_->create_member(), rng_
129 return Teuchos::null;
134 namespace rcp = MemMngPack;
135 if( full_space_.
get() )
142 namespace rcp = MemMngPack;
146 const index_type
dim = this->
dim();
150 const index_type this_offset = rng_.
lbound() - 1;
155 this_offset + rng.
lbound()
156 ,this_offset + rng.
ubound() )
void initialize(const space_ptr_t &full_space, const Range1D &rng)
Initialize.
space_ptr_t sub_space(const Range1D &rng) const
bool is_compatible(const VectorSpace &) const
space_ptr_t clone() const
vec_mut_ptr_t create_member() const
Concrete subclass for a default sub-space of a vector.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual bool is_in_core() const
Returns true if the vectors are in core.
VectorSpaceSubSpace()
Constructs to uninitialized.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const VectorSpace > space_ptr_t
void validate_range(const Range1D &rng) const
Validate rng.
Abstract interface for objects that represent a space for mutable coordinate vectors.
void set_uninitialized()
Set uninitilized.
Concrete subclass for a sub-view of a VectorMutable object.
const Range1D & rng() const
virtual index_type dim() const =0
Return the dimmension of the vector space.
static const Range1D Invalid
const space_ptr_t & full_space() const