|
AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
|
DVector "Adaptor" subclass for DenseLinAlgPack::DVectorSlice or DenseLinAlgPack::DVector objects.
More...
#include <AbstractLinAlgPack_VectorMutableDense.hpp>

Public Types | |
| typedef Teuchos::RCP < MemMngPack::ReleaseResource > | release_resource_ptr_t |
| | |
Public Member Functions | |
| VectorMutableDense * | operator& () |
| Hack. | |
Constructors/initializers | |
| VectorMutableDense (const size_type dim=0) | |
Calls this->initialize(dim). | |
| VectorMutableDense (DVectorSlice v, const release_resource_ptr_t &v_release) | |
Calls this->initialize(v,v_release). | |
| void | initialize (const size_type dim) |
Call this->initialize(v,v_release) with an allocated DenseLinAlgPack::DVector object. | |
| void | initialize (DVectorSlice v, const release_resource_ptr_t &v_release) |
| Initialize with a dense vector slice. | |
Access | |
| DVectorSlice | set_vec () |
| Return the non-const dense vector. | |
| const DVectorSlice | get_vec () const |
| Return a const dense vector. | |
| const release_resource_ptr_t & | vec_release () const |
Return a RCP<> pointer to the object that will release the associated resource. | |
Overriddenn from Vector | |
| const VectorSpace & | space () 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 |
| | |
| index_type | dim () const |
| | |
| value_type | get_ele (index_type i) const |
| | |
| void | get_sub_vector (const Range1D &rng, RTOpPack::SubVector *sub_vec) const |
| | |
| void | free_sub_vector (RTOpPack::SubVector *sub_vec) const |
| | |
Overriddenn from VectorMutable | |
| VectorMutable & | operator= (value_type alpha) |
| | |
| VectorMutable & | operator= (const Vector &v) |
| | |
| VectorMutable & | operator= (const VectorMutable &v) |
| | |
| 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) |
| | |
| void | Vp_StMtV (value_type alpha, const GenPermMatrixSlice &P, BLAS_Cpp::Transp P_trans, const Vector &x, value_type beta) |
| | |
DVector "Adaptor" subclass for DenseLinAlgPack::DVectorSlice or DenseLinAlgPack::DVector objects.
This class can be used either as a view of a DenseLinAlgPack::DVectorSlice object or as a storage type for a DenseLinAlgPack::DVector object.
To create a storage type with the dimension of dim just call the constructor VectorMutableDense(dim) or after construction you can call this->initialize(dim).
To simply create a view of a vector, say v, without ownership just call VectorMutableDense(v(),NULL) or after construction call this->initialize(v(),NULL).
Alternately, this can be given a vector with the responsibility to delete any associated memory by calling this->initialize() with a ReleaseResource object to perform the deallocation.
If this has been initialized by this->initialize(dim) and if the client really needs to get at the DenseLinAlgPack::DVector object itself, then it can be obtained as:
void f( VectorMutableDense* v ) namespace rmp = MemMngPack; DVector &_v = *dynamic_cast<rmp::ReleaseResource_ref_count_ptr<DVector>&>(*v.vec_release()).ptr;
This is not pretty but it is not supposed to be. Of course the above function will throw an exception if the dynamic_cast<> fails.
Definition at line 71 of file AbstractLinAlgPack_VectorMutableDense.hpp.
| typedef Teuchos::RCP< MemMngPack::ReleaseResource> AbstractLinAlgPack::VectorMutableDense::release_resource_ptr_t |
Definition at line 79 of file AbstractLinAlgPack_VectorMutableDense.hpp.
| AbstractLinAlgPack::VectorMutableDense::VectorMutableDense | ( | const size_type | dim = 0 | ) |
Calls this->initialize(dim).
Definition at line 52 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| AbstractLinAlgPack::VectorMutableDense::VectorMutableDense | ( | DVectorSlice | v, |
| const release_resource_ptr_t & | v_release | ||
| ) |
Calls this->initialize(v,v_release).
Definition at line 61 of file AbstractLinAlgPack_VectorMutableDense.cpp.
Call this->initialize(v,v_release) with an allocated DenseLinAlgPack::DVector object.
Definition at line 71 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::initialize | ( | DVectorSlice | v, |
| const release_resource_ptr_t & | v_release | ||
| ) |
Initialize with a dense vector slice.
Definition at line 90 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| DVectorSlice AbstractLinAlgPack::VectorMutableDense::set_vec | ( | ) | [inline] |
Return the non-const dense vector.
Note that calling this method will result in the vector implementation being modified. Therefore, no other methods on this object should be called until the DVectorSlice returned from this method is discarded.
Note that the underlying implementation calls this->has_changed() before this method returns.
Definition at line 213 of file AbstractLinAlgPack_VectorMutableDense.hpp.
| const DVectorSlice AbstractLinAlgPack::VectorMutableDense::get_vec | ( | ) | const [inline] |
Return a const dense vector.
Definition at line 221 of file AbstractLinAlgPack_VectorMutableDense.hpp.
| const VectorMutableDense::release_resource_ptr_t & AbstractLinAlgPack::VectorMutableDense::vec_release | ( | ) | const [inline] |
Return a RCP<> pointer to the object that will release the associated resource.
Definition at line 228 of file AbstractLinAlgPack_VectorMutableDense.hpp.
| const VectorSpace & AbstractLinAlgPack::VectorMutableDense::space | ( | ) | const [virtual] |
Implements AbstractLinAlgPack::Vector.
Definition at line 104 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::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] |
Implements AbstractLinAlgPack::Vector.
Definition at line 110 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| index_type AbstractLinAlgPack::VectorMutableDense::dim | ( | ) | const [virtual] |
Reimplemented from AbstractLinAlgPack::Vector.
Definition at line 131 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| value_type AbstractLinAlgPack::VectorMutableDense::get_ele | ( | index_type | i | ) | const [virtual] |
Reimplemented from AbstractLinAlgPack::Vector.
Definition at line 136 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::get_sub_vector | ( | const Range1D & | rng, |
| RTOpPack::SubVector * | sub_vec | ||
| ) | const [virtual] |
Reimplemented from AbstractLinAlgPack::Vector.
Definition at line 141 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::free_sub_vector | ( | RTOpPack::SubVector * | sub_vec | ) | const [virtual] |
Reimplemented from AbstractLinAlgPack::Vector.
Definition at line 162 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| VectorMutable & AbstractLinAlgPack::VectorMutableDense::operator= | ( | value_type | alpha | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 170 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| VectorMutable & AbstractLinAlgPack::VectorMutableDense::operator= | ( | const Vector & | v | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 179 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| VectorMutable & AbstractLinAlgPack::VectorMutableDense::operator= | ( | const VectorMutable & | v | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 191 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::set_ele | ( | index_type | i, |
| value_type | val | ||
| ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 202 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| VectorMutableDense::vec_mut_ptr_t AbstractLinAlgPack::VectorMutableDense::sub_view | ( | const Range1D & | rng | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 210 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::get_sub_vector | ( | const Range1D & | rng, |
| RTOpPack::MutableSubVector * | sub_vec | ||
| ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 229 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::commit_sub_vector | ( | RTOpPack::MutableSubVector * | sub_vec | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 250 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::set_sub_vector | ( | const RTOpPack::SparseSubVector & | sub_vec | ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 257 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| void AbstractLinAlgPack::VectorMutableDense::Vp_StMtV | ( | value_type | alpha, |
| const GenPermMatrixSlice & | P, | ||
| BLAS_Cpp::Transp | P_trans, | ||
| const Vector & | x, | ||
| value_type | beta | ||
| ) | [virtual] |
Reimplemented from AbstractLinAlgPack::VectorMutable.
Definition at line 263 of file AbstractLinAlgPack_VectorMutableDense.cpp.
| VectorMutableDense* AbstractLinAlgPack::VectorMutableDense::operator& | ( | ) | [inline] |
Hack.
Definition at line 189 of file AbstractLinAlgPack_VectorMutableDense.hpp.
1.7.4