44 #include "AbstractLinAlgPack_VectorSpaceSubSpace.hpp" 45 #include "AbstractLinAlgPack_VectorMutableSubView.hpp" 46 #include "Teuchos_Assert.hpp" 58 TEUCHOS_TEST_FOR_EXCEPTION(
59 full_space.get() == NULL, std::invalid_argument
60 ,
"VectorSpaceSubSpace::initialize(...): Error!" );
62 const index_type n = full_space->dim();
64 TEUCHOS_TEST_FOR_EXCEPTION(
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();
84 TEUCHOS_TEST_FOR_EXCEPTION(
85 full_space_.get() == NULL, std::logic_error
86 ,
"VectorSpaceSubSpace::validate_range(rng): Error, Uninitialized" );
87 TEUCHOS_TEST_FOR_EXCEPTION(
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;
124 if( full_space_.get() )
127 full_space_->create_member(), rng_
129 return Teuchos::null;
135 if( full_space_.get() )
144 return Teuchos::rcp(
this,
false);
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
virtual index_type dim() const =0
Return the dimmension of the vector space.
space_ptr_t clone() const
vec_mut_ptr_t create_member() const
Concrete subclass for a default sub-space of a vector.
virtual bool is_in_core() const
Returns true if the vectors are in core.
VectorSpaceSubSpace()
Constructs to uninitialized.
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
static const Range1D Invalid
const space_ptr_t & full_space() const
Teuchos::RCP< VectorMutable > vec_mut_ptr_t