Reference documentation for deal.II version 9.6.0
|
#include <deal.II/base/array_view.h>
Public Types | |
using | value_type = ElementType |
Public Member Functions | |
StridedArrayView (value_type *starting_element, const std::size_t n_elements) | |
std::size_t | size () const |
bool | empty () const |
value_type * | data () const noexcept |
value_type & | operator[] (const std::size_t i) const |
Protected Attributes | |
value_type * | starting_element |
std::size_t | n_elements |
A variation of ArrayView
which allows strided access into the view. This is particularly useful when you want to access only one lane of a VectorizedArray.
Definition at line 753 of file array_view.h.
using StridedArrayView< ElementType, stride >::value_type = ElementType |
An alias that denotes the "value_type" of this container-like class, i.e., the type of the element it "stores" or points to.
Definition at line 760 of file array_view.h.
StridedArrayView< ElementType, stride >::StridedArrayView | ( | value_type * | starting_element, |
const std::size_t | n_elements ) |
Constructor.
[in] | starting_element | A pointer to the first element of the array this object should represent. |
[in] | n_elements | The length (in elements) of the chunk of memory this object should represent. |
Definition at line 875 of file array_view.h.
std::size_t StridedArrayView< ElementType, stride >::size | ( | ) | const |
Return the size (in elements) of the view of memory this object represents.
Definition at line 867 of file array_view.h.
bool StridedArrayView< ElementType, stride >::empty | ( | ) | const |
Return a bool whether the array view is empty.
Definition at line 858 of file array_view.h.
|
noexcept |
Return a pointer to the underlying array serving as element storage. In case the container is empty a nullptr is returned.
Definition at line 846 of file array_view.h.
StridedArrayView< ElementType, stride >::value_type & StridedArrayView< ElementType, stride >::operator[] | ( | const std::size_t | i | ) | const |
Return a reference to the \(i\)th element of the range represented by the current object.
This function is marked as const
because it does not change the view object. It may however return a reference to a non-const
memory location depending on whether the template type of the class is const
or not.
This function is only allowed to be called if the underlying data is indeed stored in CPU memory.
Definition at line 835 of file array_view.h.
|
protected |
A pointer to the first element of the range of locations in memory that this object represents.
Definition at line 823 of file array_view.h.
|
protected |
The length of the array this object represents.
Definition at line 828 of file array_view.h.