![]() |
deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+00:00
|
#include <deal.II/base/array_view.h>
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 806 of file 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 |
| 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 813 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 928 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 920 of file array_view.h.
| bool StridedArrayView< ElementType, stride >::empty | ( | ) | const |
Return a bool whether the array view is empty.
Definition at line 911 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 899 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 888 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 876 of file array_view.h.
|
protected |
The length of the array this object represents.
Definition at line 881 of file array_view.h.