|
AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
|
Concrete subclass for a default sub-view implementation for a Vector object. More...
#include <AbstractLinAlgPack_VectorSubView.hpp>

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_t & | full_vec () const |
| | |
| const VectorSpaceSubSpace & | space_impl () const |
| | |
Overridden from Vector | |
| const VectorSpace & | space () 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 |
| | |
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.
| 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.
| 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:
full_vec.get() != NULL (throw std::invalid_argument) rng.full_range() == false] rng.lbound() <= full_vec->dim() (throw std::out_of_range). Postconditions:
this->get_ele(i) == full_vec->get_ele(rng.lbound()-1+i), for i = 1...rng.size() | 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:
this->dim() == 0 this->full_vec() = NULL 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:
dynamic_cast<const VectorSubView*>(vecs[k]) != NULL, for k=0..num_vecs (throw std::invalid_argument) dynamic_cast<VectorMutableSubView*>(targ_vecs[k]) != NULL, for k=0..num_targ_vecs (throw std::invalid_argument) dynamic_cast<const VectorSubView*>(vecs[k])->full_vec()->space().is_compatible( this->full_vec()->space() ) == true, for k=0..num_vecs (throw VectorSpace::IncompatibleVectorSpaces) dynamic_cast<VectorMutableSubView>(targ_vecs[k])->full_vec()->space().is_compatible( this->full_vec()->space() ) == true, for k=0..num_targ_vecs (throw VectorSpace::IncompatibleVectorSpaces) 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.
1.7.4