14#ifndef EBGEOMETRY_ARRAY_HPP
15#define EBGEOMETRY_ARRAY_HPP
31template <
class T, std::
size_t N>
34 static_assert(N > 0,
"Array<T, N> requires N > 0");
70 static constexpr std::size_t
148 fill(
const T& a_value)
noexcept
150 for (std::size_t i = 0; i < N; i++) {
164 for (std::size_t i = 0; i < N; i++) {
165 if (!(
m_data[i] == a_other.m_data[i])) {
182 return !(*
this == a_other);
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Fixed-size array with host- and device-callable members.
Definition EBGeometry_Array.hpp:33
constexpr bool operator==(const Array &a_other) const noexcept
Element-wise equality.
Definition EBGeometry_Array.hpp:162
constexpr T & operator[](const std::size_t a_i) noexcept
Element access.
Definition EBGeometry_Array.hpp:48
T m_data[N]
The elements. Public so that the type is an aggregate; use operator[] or data().
Definition EBGeometry_Array.hpp:39
constexpr const T & operator[](const std::size_t a_i) const noexcept
Element access.
Definition EBGeometry_Array.hpp:60
constexpr bool operator!=(const Array &a_other) const noexcept
Element-wise inequality.
Definition EBGeometry_Array.hpp:180
constexpr const T * begin() const noexcept
Iterator to the first element.
Definition EBGeometry_Array.hpp:115
constexpr const T * data() const noexcept
Pointer to the first element.
Definition EBGeometry_Array.hpp:93
constexpr T * end() noexcept
Iterator past the last element.
Definition EBGeometry_Array.hpp:126
constexpr T * begin() noexcept
Iterator to the first element.
Definition EBGeometry_Array.hpp:104
constexpr void fill(const T &a_value) noexcept
Set every element to a value.
Definition EBGeometry_Array.hpp:148
static constexpr std::size_t size() noexcept
Number of elements.
Definition EBGeometry_Array.hpp:71
constexpr const T * end() const noexcept
Iterator past the last element.
Definition EBGeometry_Array.hpp:137
constexpr T * data() noexcept
Pointer to the first element.
Definition EBGeometry_Array.hpp:82