![]() |
Reference documentation for deal.II version GIT 9042b9283b 2023-12-02 14:50:02+00:00
|
#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 754 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 761 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 876 of file array_view.h.
std::size_t StridedArrayView< ElementType, stride >::size |
Return the size (in elements) of the view of memory this object represents.
Definition at line 868 of file array_view.h.
bool StridedArrayView< ElementType, stride >::empty |
Return a bool whether the array view is empty.
Definition at line 859 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 847 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 836 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 824 of file array_view.h.
|
protected |
The length of the array this object represents.
Definition at line 829 of file array_view.h.