#include <AbstractLinAlgPack_VectorMutable.hpp>
Inheritance diagram for AbstractLinAlgPack::VectorMutable:
Virtual methods with default implementations | |
| virtual VectorMutable & | operator= (value_type alpha) |
Assign the elements of this vector to a scalar. | |
| virtual VectorMutable & | operator= (const Vector &v) |
Assign the elements of a vector to this. | |
| virtual VectorMutable & | operator= (const VectorMutable &v) |
Default implementation calls operator=((const &Vector)v). | |
| virtual void | set_ele (index_type i, value_type val) |
| Set a specific element of a vector. | |
| virtual vec_mut_ptr_t | sub_view (const Range1D &rng) |
| Create a mutable abstract view of a vector object. | |
| 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)). | |
| virtual void | zero () |
| Zeros this vector. | |
| virtual void | axpy (value_type alpha, const Vector &x) |
| Adds a linear combination of another vector to this vector object. | |
| virtual void | get_sub_vector (const Range1D &rng, RTOpPack::MutableSubVector *sub_vec) |
| Get a mutable explicit view of a sub-vector. | |
| virtual void | commit_sub_vector (RTOpPack::MutableSubVector *sub_vec) |
| Free a mutable explicit view of a sub-vector. | |
| virtual void | set_sub_vector (const RTOpPack::SparseSubVector &sub_vec) |
| Set a specific sub-vector. | |
| 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. | |
Overridden from Vector | |
| vec_ptr_t | sub_view (const Range1D &rng) const |
Default implementation calls this->sub_view() (non-const) and then performs an cast to vec_ptr_t. | |
Public Member Functions | |
| virtual void | get_sub_vector (const Range1D &rng, RTOpPack::SubVector *sub_vec) const |
| | |
| virtual void | free_sub_vector (RTOpPack::SubVector *sub_vec) const |
| | |
Objects of this type can act as a target vector of a transformation operation. Similarly to Vector this interface contains very few (only one extra) pure virtual methods that must be overridden. However, more efficient and more general implementations will choose to override more methods.
In addition to being able to create non-mutable (const) abstract sub-views of a vector object thorugh the Vector interface, this interface allows the creation of mutable (non-const) sub-views using sub_view(). Also, in addition to being able to extract an explicit non-mutable view of some (small?) sub-set of elements, this interface allows a client to either extract a explicit mutable sub-views using get_sub_vector() or to set sub-vectors using set_sub_vector(). As much as possible, abstract views should be preferred (i.e. sub_view()) over explict views (i.e. get_sub_vector() and set_sub_vector()).
There are only two pure virtual methods that a concreate VectorMutable subclass must override. The space() and apply_op() methods from the Vector base class inteface must be defined.
The non-mutable (const) sub_view(...) method from the Vector interface has a default implementation defined here that will be adequate for most subclasses.
Definition at line 59 of file AbstractLinAlgPack_VectorMutable.hpp.
|
|
Assign the elements of
The default implementation of this function uses a transforamtion operator class (see RTOp_TOp_assign_scalar.h) and calls Reimplemented in AbstractLinAlgPack::VectorMutableBlocked, and AbstractLinAlgPack::VectorMutableDense. Definition at line 79 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Assign the elements of a vector to
The default implementation of this function uses a transforamtion operator class (see RTOp_TOp_assign_vectors.h) and calls Reimplemented in AbstractLinAlgPack::VectorMutableBlocked, and AbstractLinAlgPack::VectorMutableDense. Definition at line 87 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Default implementation calls
Reimplemented in AbstractLinAlgPack::VectorMutableDense. Definition at line 97 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||
|
Set a specific element of a vector. Preconditions:
Postconditions:
The default implementation uses a transforamtion operator class (see RTOp_TOp_set_ele.h) and calls
Reimplemented in AbstractLinAlgPack::VectorMutableSubView, AbstractLinAlgPack::VectorMutableBlocked, and AbstractLinAlgPack::VectorMutableDense. Definition at line 102 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Create a mutable abstract view of a vector object.
This is only a transient view of a sub-vector that is to be immediately used and then released by
The compatibility of sub-views goes along with the compatibility of sub-spaces (see VectorSpace). For example, given the vector objects where Preconditions:
Reimplemented in AbstractLinAlgPack::VectorMutableSubView, AbstractLinAlgPack::VectorMutableBlocked, and AbstractLinAlgPack::VectorMutableDense. Definition at line 113 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||
|
Inline member function that simply calls
Definition at line 294 of file AbstractLinAlgPack_VectorMutable.hpp. |
|
|
Zeros this vector.
Calls Definition at line 135 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||
|
Adds a linear combination of another vector to this vector object.
Calls Reimplemented in AbstractLinAlgPack::VectorMutableBlocked. Definition at line 140 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||
|
Get a mutable explicit view of a sub-vector.
This is only a transient view of a sub-vector that is to be immediately used and then released with a call to
Note that calling this operation might require some internal allocations and temporary memory. Therefore, it is critical that
If
Changes to the underlying sub-vector are not guarrenteed to become permanent until Preconditions:
This method has a default implementation based on a vector reduction operator class (see RTOp_ROp_get_sub_vector.h) and calls
Reimplemented in AbstractLinAlgPack::VectorMutableSubView, and AbstractLinAlgPack::VectorMutableDense. Definition at line 148 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Free a mutable explicit view of a sub-vector.
The sub-vector view must have been allocated by
This method has a default implementation which is a companion to the default implementation for
Reimplemented in AbstractLinAlgPack::VectorMutableSubView, and AbstractLinAlgPack::VectorMutableDense. Definition at line 165 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Set a specific sub-vector.
After this function returns, the corresponding elements in Preconditions:
The default implementation of this operation uses a transformation operator class (see RTOp_TOp_set_sub_vector.h) and calls
Reimplemented in AbstractLinAlgPack::VectorMutableSubView, AbstractLinAlgPack::VectorMutableBlocked, and AbstractLinAlgPack::VectorMutableDense. Definition at line 177 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||||||||||||||
|
Perform a gather or scatter operation with a vector.
this = alpha * op(P) * x + beta * this
The default implementation is based on a transformation or reduction operator (depending if a gather or scatter is being performed). Reimplemented in AbstractLinAlgPack::VectorMutableDense. Definition at line 205 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
|
Default implementation calls This function override is actually needed here for another reason. Without, the override, the non-const version defined in this interface hides the const version defined in Vector. Reimplemented from AbstractLinAlgPack::Vector. Reimplemented in AbstractLinAlgPack::VectorMutableSubView. Definition at line 226 of file AbstractLinAlgPack_VectorMutable.cpp. |
|
||||||||||||
|
|
|
|
|
1.3.9.1