![]() |
Reference documentation for deal.II version 8.1.0
|
#include <vector_slice.h>
Public Member Functions | |
VectorSlice (VECTOR &v) | |
VectorSlice (VECTOR &v, unsigned int start, unsigned int length) | |
unsigned int | size () const |
VECTOR::reference | operator[] (unsigned int i) |
VECTOR::const_reference | operator[] (unsigned int i) const |
VECTOR::iterator | begin () |
VECTOR::const_iterator | begin () const |
VECTOR::iterator | end () |
VECTOR::const_iterator | end () const |
Private Attributes | |
VECTOR & | v |
const unsigned int | start |
const unsigned int | length |
Related Functions | |
(Note that these are not member functions.) | |
template<class VECTOR > | |
const VectorSlice< const VECTOR > | make_slice (VECTOR &v) |
template<class VECTOR > | |
const VectorSlice< const VECTOR > | make_slice (VECTOR &v, const unsigned int start, const unsigned int length) |
Filter a range out of any object having a random access operator[] (unsigned int)
and a function size() const
.
The use of this object is straightforward. It duplicates the random access operator of the VECTOR
and adds an offset to every index.
Some precautions have to be taken if it is used for a constant vector: the VectorSlice object has to be constant, too. The appropriate initalization sequence is like this:
Definition at line 38 of file sparsity_pattern.h.
|
inline |
Construct a vector slice containing the whole vector. Comes handy, if you did not want to have a slice at all, but the function you call wants it: just put in the vector itself as argument and let this constructor make a slice for you.
Definition at line 176 of file vector_slice.h.
|
inline |
The real constructor for a vector slice, allowing you to specify the start index and the length of the slice.
Definition at line 184 of file vector_slice.h.
|
inline |
Return the length of the slice using the same interface as std::vector
.
Definition at line 198 of file vector_slice.h.
|
inline |
Access an element of the slice using the same interface as std::vector
.
Definition at line 207 of file vector_slice.h.
|
inline |
Access an element of a constant slice using the same interface as std::vector
.
Definition at line 218 of file vector_slice.h.
|
inline |
STL conforming iterator function.
Definition at line 238 of file vector_slice.h.
|
inline |
STL conforming iterator function.
Definition at line 229 of file vector_slice.h.
|
inline |
STL conforming iterator function.
Definition at line 256 of file vector_slice.h.
|
inline |
STL conforming iterator function.
Definition at line 247 of file vector_slice.h.
|
related |
Helper function for creating temporary objects without typing template arguments.
Definition at line 143 of file vector_slice.h.
|
related |
Helper function for creating temporary objects without typing template arguments.
Definition at line 161 of file vector_slice.h.
|
private |
The vector we extract from.
Definition at line 121 of file vector_slice.h.
|
private |
The start index of the slice.
Definition at line 125 of file vector_slice.h.
|
private |
The length of the slice.
Definition at line 129 of file vector_slice.h.