#include <AbstractLinAlgPack_SparseVectorClassDecl.hpp>
Inheritance diagram for AbstractLinAlgPack::SparseVectorSlice< T_Element >:
Public types. | |
| typedef T_Element | element_type |
| | |
| typedef AbstractLinAlgPack::size_type | size_type |
| | |
| typedef ptrdiff_t | difference_type |
| | |
| typedef element_type * | iterator |
| | |
| typedef const element_type * | const_iterator |
| | |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| | |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
| | |
| typedef SparseVectorUtilityPack::DoesNotExistException | DoesNotExistException |
| | |
| typedef SparseVectorUtilityPack::NotSortedException | NotSortedException |
| | |
Constuctors | |
| The default copy constructor is allowed since it has the proper semantics. | |
| SparseVectorSlice (element_type ele[], size_type nz, difference_type offset, size_type size, bool assume_sorted=false) | |
| Constructs a sparse vector slice from an array of elements. | |
Sparse Vector Templated interface for linear algebra operations | |
| size_type | dim () const |
| Return the number of elements in the full vector. | |
| size_type | nz () const |
| Return the number of non-zero elements. | |
| difference_type | offset () const |
| Return the offset for the indexes (ith real index = begin()[i-1]->index() + offset()# , for i = 1,,,nz()#). | |
| bool | is_sorted () const |
| Return true if the sequence is assumed sorted. | |
| iterator | begin () |
| | |
| const_iterator | begin () const |
| | |
| const_iterator | end () const |
| | |
| reverse_iterator | rbegin () |
| | |
| const_reverse_iterator | rbegin () const |
| | |
| const_reverse_iterator | rend () const |
| | |
Lookup an element. | |
| If element v(i) exists, then a pointer to the element will be returned. If v(i) does not exist, then the NULL pointer will be returned. If i is out of range then a std::out_of_range exception will be thrown.
If the elements are sored then this operation is O(log(nz)) for a binary search. Otherwise, it requries a O(nz) linear search. | |
| element_type * | lookup_element (size_type i) |
| | |
| const element_type * | lookup_element (size_type i) const |
| | |
Creating a slice (subregion) of the sparse vector | |
| SparseVectorSlice< T_Element > & | operator() () |
| const SparseVectorSlice< T_Element > & | operator() () const |
| | |
| SparseVectorSlice * | operator & () |
| Allow address to be taken of an rvalue of this object. | |
| SparseVectorSlice< T_Element > | operator() (const Range1D &rng) |
| const SparseVectorSlice< T_Element > | operator() (const Range1D &rng) const |
| | |
| SparseVectorSlice< T_Element > | operator() (size_type lbound, size_type ubound) |
| const SparseVectorSlice< T_Element > | operator() (size_type lbound, size_type ubound) const |
| | |
Public Member Functions | |
| void | bind (SparseVectorSlice svs) |
| Constructs a sparse vector slice view from another sparse vector slice. | |
| EOverLap | overlap (const SparseVectorSlice< T_Element > &sv) const |
This is a class for abstracting a region of a sparse vector stored as an array of elements of a templated type. The required inteface for the type of these elements is given in the SparseVector documentation.
Here if nz() == 0 then begin() == end() so it is safe to set up loops in the form of:
for(SparseVectorSlice<T>::const_iterator itr = sv.begin(); itr != sv.end(); ++itr) // some access of *itr.
Note that if nz()==0 then begin() may not point to a valid object so don't do it.
The default copy constructor is allowed but the default constructor and assignment operator functions are not.
Definition at line 542 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp.
|
|||||
|
Definition at line 548 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 550 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 552 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 554 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 556 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 570 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 572 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 577 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||
|
Definition at line 579 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||||||||||||||||||||
|
Constructs a sparse vector slice from an array of elements. Here a pointer to an array of elements is used instead of a pointer to std::vector<T_Ele,T_Alloc> in order to insulated this class from the type of allocator used since this information is not needed. A sparse vector slice with no nonzero elements can be constructed by setting nz == 0; Preconditions:
Definition at line 999 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Constructs a sparse vector slice view from another sparse vector slice.
Definition at line 1005 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Returns the degree of memory overlap of this SparseVector and a SparseVectorSlice.
Definition at line 409 of file AbstractLinAlgPack_SparseVectorClassDef.hpp. |
|
|||||||||
|
Return the number of elements in the full vector.
Definition at line 1015 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Return the number of non-zero elements.
Definition at line 1020 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Return the offset for the indexes (ith real index = begin()[i-1]->index() + offset()# , for i = 1,,,nz()#).
Definition at line 1025 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Return true if the sequence is assumed sorted.
Definition at line 1030 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1035 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1040 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1050 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1055 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1060 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1070 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Definition at line 1079 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Definition at line 1087 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Returns a SparseVectorSlice<> reference to this object. It is included for uniformity with SparseVector. Definition at line 1095 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Definition at line 1100 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
|||||||||
|
Allow address to be taken of an rvalue of this object.
Definition at line 710 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Returns a continous subregion of the SparseVector object. The returned SparseVectorSlice object represents the range of the rng argument. Preconditions: Postconditions:
Definition at line 1105 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||
|
Definition at line 1110 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||||||||
|
Returns a SparseVectorSlice object for the continous subregion [ubound, lbound]. Preconditions:
Postconditions:
Definition at line 1115 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
|
||||||||||||||||
|
Definition at line 1120 of file AbstractLinAlgPack_SparseVectorClassDecl.hpp. |
1.3.9.1