51 namespace AbstractLinAlgPack {
60 namespace rcp = MemMngPack;
63 vec.get() == NULL, std::invalid_argument
64 ,
"VectorSubView::initialize(...) : Error!" );
93 ,
const size_t num_vecs,
const Vector* vecs[]
95 ,RTOpPack::ReductTarget* reduct_obj
104 if( this->
space().is_in_core() ) {
106 op,num_vecs,vecs,num_targ_vecs,targ_vecs,reduct_obj
107 ,first_ele_in,sub_dim_in,global_offset_in
117 || !(1 <= first_ele_in && first_ele_in <= this_dim)
118 || ( sub_dim_in > 0 && (sub_dim_in - (first_ele_in - 1) > this_dim) )
120 ,
"VectorSubView::apply_op(...): Error, first_ele_in = "
121 << first_ele_in <<
", global_offset_in = " << global_offset_in
122 <<
", sub_dim_in = " << sub_dim_in <<
" and this->dim() = this_dim = "
123 << this_dim <<
" are not compatible." );
127 this_sub_dim = ( sub_dim_in
131 Workspace<const Vector*> vecs_full(wss,num_vecs);
132 for( k = 0; k < num_vecs; ++k )
133 vecs_full[k] = dyn_cast<const VectorSubView>(*vecs[k]).full_vec().get();
134 Workspace<VectorMutable*> targ_vecs_full(wss,num_targ_vecs);
135 for( k = 0; k < num_targ_vecs; ++k )
136 targ_vecs_full[k] = dyn_cast<VectorMutableSubView>(*targ_vecs[k]).full_vec().get();
139 ,num_vecs, num_vecs ? &vecs_full[0] : NULL
140 ,num_targ_vecs, num_targ_vecs ? &targ_vecs_full[0] : NULL
142 ,this_offset + first_ele_in
157 namespace rcp = MemMngPack;
159 const Range1D rng = RangePack::full_range(rng_in,1,this_dim);
166 this_offset + rng.
lbound()
167 ,this_offset + rng.
ubound() )
177 const Range1D rng = RangePack::full_range(rng_in,1,this_dim);
180 full_vec_->get_sub_vector( rng + this_offset, sub_vec );
void initialize(const space_ptr_t &full_space, const Range1D &rng)
Initialize.
const VectorSpaceSubSpace & space_impl() const
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
void get_sub_vector(const Range1D &rng, RTOpPack::SubVector *sub_vec) const
RTOp_index_type index_type
const VectorSpace & space() const
RTOp_value_type value_type
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Index size() const
Return the size of the range (ubound() - lbound() + 1)
Index ubound() const
Return upper bound of the range.
value_type get_ele(index_type i) const
void free_sub_vector(RTOpPack::SubVector *sub_vec) const
vec_ptr_t full_vec_
If full_vec_.get() == NULL, the vector is uninitalized (dim == 0).
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
. One-based subregion index range class.
virtual void has_changed() const
Must be called by any vector subclass that modifies this vector object!
void validate_range(const Range1D &rng) const
Validate rng.
RTOpT< RTOp_value_type > RTOp
Abstract interface for objects that represent a space for mutable coordinate vectors.
T_To & dyn_cast(T_From &from)
void set_uninitialized()
Set uninitilized.
VectorSpaceSubSpace space_
The space that this vector belongs to.
VectorSubView()
Constructs to uninitialized.
void set_uninitialized()
Set uninitialized()
const Range1D & rng() const
Teuchos_Ordinal globalOffset() const
vec_ptr_t sub_view(const Range1D &rng) const
Index lbound() const
Return lower bound of the range.
Abstract interface for mutable coordinate vectors {abstract}.
void apply_op(EApplyBy apply_by, const RTOpPack::RTOp &primary_op, const size_t num_multi_vecs, const MultiVector *multi_vecs[], const size_t num_targ_multi_vecs, MultiVectorMutable *targ_multi_vecs[], RTOpPack::ReductTarget *reduct_objs[]=NULL, const index_type primary_first_ele=1, const index_type primary_sub_dim=0, const index_type primary_global_offset=0, const index_type secondary_first_ele=1, const index_type secondary_sub_dim=0)
Apply a reduction/transformation operator column by column and return an array of the reduction objec...
void setGlobalOffset(Teuchos_Ordinal globalOffset)
void apply_op_serial(const RTOpPack::RTOp &op, const size_t num_vecs, const Vector *vecs[], const size_t num_targ_vecs, VectorMutable *targ_vecs[], RTOpPack::ReductTarget *reduct_obj, const index_type first_ele, const index_type sub_dim, const index_type global_offset) const
void initialize(const vec_ptr_t &full_vec, const Range1D &rng)
Initialize a sub-view based on a full vector.
RangePack::Range1D Range1D
Class for a non-mutable sub-vector.
TEUCHOSCORE_LIB_DLL_EXPORT Teuchos::RCP< WorkspaceStore > get_default_workspace_store()
void apply_op(const RTOpPack::RTOp &op, const size_t num_vecs, const Vector *vecs[], const size_t num_targ_vecs, VectorMutable *targ_vecs[], RTOpPack::ReductTarget *reduct_obj, const index_type first_ele, const index_type sub_dim, const index_type global_offset) const
Calls apply_op() on the underlying full vectors.