Reference documentation for deal.II version 8.5.1
|
#include <deal.II/base/vector_slice.h>
Public Member Functions | |
VectorSlice (VectorType &v) | |
VectorSlice (VectorType &v, unsigned int start, unsigned int length) | |
operator ArrayView< typename VectorType::value_type * > () | |
operator ArrayView< const typename VectorType::value_type * > () const | |
unsigned int | size () const |
VectorType::reference | operator[] (unsigned int i) |
VectorType::const_reference | operator[] (unsigned int i) const |
VectorType::iterator | begin () |
VectorType::const_iterator | begin () const |
VectorType::iterator | end () |
VectorType::const_iterator | end () const |
Private Attributes | |
VectorType & | v |
const unsigned int | start |
const unsigned int | length |
Related Functions | |
(Note that these are not member functions.) | |
template<typename VectorType > | |
const VectorSlice< const VectorType > | make_slice (VectorType &v) |
template<typename VectorType > | |
const VectorSlice< const VectorType > | make_slice (VectorType &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 VectorType
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 initialization sequence is like this:
Definition at line 49 of file vector_slice.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.
VectorSlice< VectorType >::operator ArrayView< typename VectorType::value_type *> | ( | ) |
Conversion operator to an ArrayView object that represents an array of non-const elements pointing to the same location as the current object.
Definition at line 206 of file vector_slice.h.
VectorSlice< VectorType >::operator ArrayView< const typename VectorType::value_type *> | ( | ) | const |
Conversion operator to an ArrayView object that represents an array of const elements pointing to the same location as the current object.
Definition at line 214 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 |
Return a reference to the \(i\)th element of the range represented by the current object.
Definition at line 223 of file vector_slice.h.
|
inline |
Return a const
reference to the \(i\)th element of the range represented by the current object.
Definition at line 234 of file vector_slice.h.
|
inline |
Standard-conforming iterator function.
Definition at line 254 of file vector_slice.h.
|
inline |
Standard-conforming iterator function.
Definition at line 245 of file vector_slice.h.
|
inline |
Standard-conforming iterator function.
Definition at line 272 of file vector_slice.h.
|
inline |
Standard-conforming iterator function.
Definition at line 263 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.