AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects
Version of the Day
|
Concrete subclass for a sub-view of a VectorMutable object. More...
#include <AbstractLinAlgPack_VectorMutableSubView.hpp>
Public Member Functions | |
VectorMutableSubView () | |
Constructs to uninitialized. More... | |
VectorMutableSubView (const vec_mut_ptr_t &full_vec, const Range1D &rng) | |
Calls this->initialize() . More... | |
void | initialize (const vec_mut_ptr_t &vec, const Range1D &rng) |
Initialize. More... | |
void | set_uninitialized () |
Set uninitialized() More... | |
const vec_mut_ptr_t & | full_vec () const |
Public Member Functions inherited from AbstractLinAlgPack::VectorMutable | |
virtual VectorMutable & | operator= (value_type alpha) |
Assign the elements of this vector to a scalar. More... | |
virtual VectorMutable & | operator= (const Vector &v) |
Assign the elements of a vector to this . More... | |
virtual VectorMutable & | operator= (const VectorMutable &v) |
Default implementation calls operator=((const &Vector)v) . More... | |
vec_mut_ptr_t | sub_view (const index_type &l, const index_type &u) |
Inline member function that simply calls this->sub_view(Range1D(l,u)) . More... | |
virtual void | zero () |
Zeros this vector. More... | |
virtual void | axpy (value_type alpha, const Vector &x) |
Adds a linear combination of another vector to this vector object. More... | |
virtual void | Vp_StMtV (value_type alpha, const GenPermMatrixSlice &P, BLAS_Cpp::Transp P_trans, const Vector &x, value_type beta) |
Perform a gather or scatter operation with a vector. More... | |
Public Member Functions inherited from AbstractLinAlgPack::Vector | |
Vector () | |
virtual | ~Vector () |
vec_ptr_t | sub_view (const index_type &l, const index_type &u) const |
Inline member function that simply calls this->sub_view(Range1D(l,u)) . More... | |
virtual void | has_changed () const |
Must be called by any vector subclass that modifies this vector object! More... | |
virtual index_type | nz () const |
Return the number of nonzero elements in the vector. More... | |
virtual std::ostream & | output (std::ostream &out, bool print_dim=true, bool newline=true, index_type global_offset=0) const |
Virtual output function. More... | |
virtual vec_mut_ptr_t | clone () const |
Create a clone of this vector objet. More... | |
virtual value_type | norm_1 () const |
One norm. ||v||_1 = sum( |v(i)|, i = 1,,,this->dim() ) More... | |
virtual value_type | norm_2 () const |
Two norm. ||v||_2 = sqrt( sum( v(i)^2, i = 1,,,this->dim() ) ) More... | |
virtual value_type | norm_inf () const |
Infinity norm. ||v||_inf = max( |v(i)|, i = 1,,,this->dim() ) More... | |
virtual value_type | inner_product (const Vector &v) const |
Return the inner product of *this with v . More... | |
Public Member Functions inherited from AbstractLinAlgPack::VectorSubView | |
VectorSubView () | |
Constructs to uninitialized. More... | |
VectorSubView (const vec_ptr_t &full_vec, const Range1D &rng) | |
Calls this->initialize() . More... | |
void | initialize (const vec_ptr_t &full_vec, const Range1D &rng) |
Initialize a sub-view based on a full vector. More... | |
void | set_uninitialized () |
Set uninitialized() More... | |
const vec_ptr_t & | full_vec () const |
const VectorSpaceSubSpace & | space_impl () const |
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. More... | |
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 |
Overridden from Vector | |
vec_ptr_t | sub_view (const Range1D &rng) const |
Overridden to pick VectorSubView::sub_view(). More... | |
Overridden from VectorMutable | |
void | set_ele (index_type i, value_type val) |
vec_mut_ptr_t | sub_view (const Range1D &rng) |
void | get_sub_vector (const Range1D &rng, RTOpPack::MutableSubVector *sub_vec) |
void | commit_sub_vector (RTOpPack::MutableSubVector *sub_vec) |
void | set_sub_vector (const RTOpPack::SparseSubVector &sub_vec) |
Additional Inherited Members | |
Public Types inherited from AbstractLinAlgPack::Vector | |
typedef Teuchos::RCP< const Vector > | vec_ptr_t |
typedef Teuchos::RCP < VectorMutable > | vec_mut_ptr_t |
Protected Member Functions inherited from AbstractLinAlgPack::Vector | |
virtual void | finalize_apply_op (const size_t num_targ_vecs, VectorMutable **targ_vecs) const |
This method usually needs to be called by subclasses at the end of the apply_op() method implementation to insure that has_changed() is called on the transformed vector objects. More... | |
Protected Member Functions inherited from AbstractLinAlgPack::VectorApplyOpSerialBase | |
VectorApplyOpSerialBase () | |
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 |
Concrete subclass for a sub-view of a VectorMutable object.
Not all of the methods from VectorMutable are overridden, only those that need to be or may result in better performance.
The default constructor and copy constructors are allowd but the default assignment operator is not allowed since it does not have the correct sematics.
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()
.
Definition at line 63 of file AbstractLinAlgPack_VectorMutableSubView.hpp.
|
inline |
Constructs to uninitialized.
Postconditions: see set_uninitialized()
.
Definition at line 138 of file AbstractLinAlgPack_VectorMutableSubView.hpp.
AbstractLinAlgPack::VectorMutableSubView::VectorMutableSubView | ( | const vec_mut_ptr_t & | full_vec, |
const Range1D & | rng | ||
) |
Calls this->initialize()
.
Definition at line 49 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
void AbstractLinAlgPack::VectorMutableSubView::initialize | ( | const vec_mut_ptr_t & | vec, |
const Range1D & | rng | ||
) |
Initialize.
Constructs a view of the vector this = vec(rng).
full_vec | [in] The original full vector. It is allowed for full_vec.get() == NULL in which case this is uninitialized (i.e. this->dim() == 0 ). |
rng | [in] The range of elements in full_vec that this vector will represent. |
Definition at line 54 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
void AbstractLinAlgPack::VectorMutableSubView::set_uninitialized | ( | ) |
Set uninitialized()
Postconditions:
this->dim() == 0
this->full_vec() = NULL
Definition at line 62 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
inline |
Definition at line 143 of file AbstractLinAlgPack_VectorMutableSubView.hpp.
|
virtual |
Overridden to pick VectorSubView::sub_view().
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 71 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
virtual |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 78 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
virtual |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 86 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
virtual |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 107 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
virtual |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 120 of file AbstractLinAlgPack_VectorMutableSubView.cpp.
|
virtual |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 131 of file AbstractLinAlgPack_VectorMutableSubView.cpp.