AbstractLinAlgPack::VectorSubView Class Reference

Concrete subclass for a default sub-view implementation for a Vector object. More...

#include <AbstractLinAlgPack_VectorSubView.hpp>

Inheritance diagram for AbstractLinAlgPack::VectorSubView:

[legend]
List of all members.

Overridden from Vector

const VectorSpacespace () const
 
index_type dim () const
 
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.
value_type get_ele (index_type i) const
 
vec_ptr_t sub_view (const Range1D &rng) const
 
void get_sub_vector (const Range1D &rng, RTOpPack::SubVector *sub_vec) const
 
void free_sub_vector (RTOpPack::SubVector *sub_vec) const
 

Public Member Functions

 VectorSubView ()
 Constructs to uninitialized.
 VectorSubView (const vec_ptr_t &full_vec, const Range1D &rng)
 Calls this->initialize().
void initialize (const vec_ptr_t &full_vec, const Range1D &rng)
 Initialize a sub-view based on a full vector.
void set_uninitialized ()
 Set uninitialized().
const vec_ptr_tfull_vec () const
 
const VectorSpaceSubSpacespace_impl () const
 

Private Member Functions

VectorSubViewoperator= (const VectorSubView &)

Private Attributes

vec_ptr_t full_vec_
 If full_vec_.get() == NULL, the vector is uninitalized (dim == 0).
VectorSpaceSubSpace space_
 The space that this vector belongs to.

Detailed Description

Concrete subclass for a default sub-view implementation for a Vector object.

Not all of the methods from Vector are overridden, only those that need to be or may result in better performance.

There is really not much to this vector subclass. The subclass is only possible because of the first_ele, sub_dim, and global_offset options with apply_op(). The vector space object returned by this->space() is of type VectorSpaceSubSpace which in turn relys on VectorSpace::sub_space().

The default constructor and copy constructors are allowed but the default assignment operator is not allowed.

Definition at line 53 of file AbstractLinAlgPack_VectorSubView.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::VectorSubView::VectorSubView (  )  [inline]

Constructs to uninitialized.

Postconditions: see set_uninitialized().

Definition at line 152 of file AbstractLinAlgPack_VectorSubView.hpp.

AbstractLinAlgPack::VectorSubView::VectorSubView ( const vec_ptr_t full_vec,
const Range1D rng 
)

Calls this->initialize().

Definition at line 40 of file AbstractLinAlgPack_VectorSubView.cpp.


Member Function Documentation

void AbstractLinAlgPack::VectorSubView::initialize ( const vec_ptr_t full_vec,
const Range1D rng 
)

Initialize a sub-view based on a full vector.

Constructs a view of the vector this = vec(rng).

Preconditions:

Postconditions:

Parameters:
full_vec [in] The original full vector.
rng [in] The range of elements in full_vec that this vector will represent.

Definition at line 45 of file AbstractLinAlgPack_VectorSubView.cpp.

void AbstractLinAlgPack::VectorSubView::set_uninitialized (  ) 

Set uninitialized().

Postconditions:

Reimplemented in AbstractLinAlgPack::VectorMutableSubView.

Definition at line 59 of file AbstractLinAlgPack_VectorSubView.cpp.

const VectorSubView::vec_ptr_t & AbstractLinAlgPack::VectorSubView::full_vec (  )  const [inline]

Reimplemented in AbstractLinAlgPack::VectorMutableSubView.

Definition at line 157 of file AbstractLinAlgPack_VectorSubView.hpp.

const VectorSpaceSubSpace & AbstractLinAlgPack::VectorSubView::space_impl (  )  const [inline]

Definition at line 163 of file AbstractLinAlgPack_VectorSubView.hpp.

const VectorSpace & AbstractLinAlgPack::VectorSubView::space (  )  const [virtual]

Implements AbstractLinAlgPack::Vector.

Definition at line 68 of file AbstractLinAlgPack_VectorSubView.cpp.

index_type AbstractLinAlgPack::VectorSubView::dim (  )  const [virtual]

Reimplemented from AbstractLinAlgPack::Vector.

Definition at line 73 of file AbstractLinAlgPack_VectorSubView.cpp.

void AbstractLinAlgPack::VectorSubView::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 [virtual]

Calls apply_op() on the underlying full vectors.

Preconditions:

Implements AbstractLinAlgPack::Vector.

Definition at line 78 of file AbstractLinAlgPack_VectorSubView.cpp.

value_type AbstractLinAlgPack::VectorSubView::get_ele ( index_type  i  )  const [virtual]

Reimplemented from AbstractLinAlgPack::Vector.

Definition at line 135 of file AbstractLinAlgPack_VectorSubView.cpp.

Vector::vec_ptr_t AbstractLinAlgPack::VectorSubView::sub_view ( const Range1D rng  )  const [virtual]

Reimplemented from AbstractLinAlgPack::Vector.

Reimplemented in AbstractLinAlgPack::VectorMutableSubView.

Definition at line 142 of file AbstractLinAlgPack_VectorSubView.cpp.

void AbstractLinAlgPack::VectorSubView::get_sub_vector ( const Range1D rng,
RTOpPack::SubVector sub_vec 
) const [virtual]

Reimplemented from AbstractLinAlgPack::Vector.

Definition at line 158 of file AbstractLinAlgPack_VectorSubView.cpp.

void AbstractLinAlgPack::VectorSubView::free_sub_vector ( RTOpPack::SubVector sub_vec  )  const [virtual]

Reimplemented from AbstractLinAlgPack::Vector.

Definition at line 171 of file AbstractLinAlgPack_VectorSubView.cpp.

VectorSubView& AbstractLinAlgPack::VectorSubView::operator= ( const VectorSubView  )  [private]


Member Data Documentation

vec_ptr_t AbstractLinAlgPack::VectorSubView::full_vec_ [private]

If full_vec_.get() == NULL, the vector is uninitalized (dim == 0).

Reimplemented in AbstractLinAlgPack::VectorMutableSubView.

Definition at line 140 of file AbstractLinAlgPack_VectorSubView.hpp.

VectorSpaceSubSpace AbstractLinAlgPack::VectorSubView::space_ [private]

The space that this vector belongs to.

Definition at line 141 of file AbstractLinAlgPack_VectorSubView.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:54:05 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7